반응형
파이어베이스 SDK 다운로드
압축 푼 뒤
dotnet4 / FirebaseAuth.unitypackage 설치
- 코드 작성
using Firebase;
using Firebase.Extensions;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FirebaseAuth : MonoBehaviour
{
void Start()
{
FirebaseInit();
}
void FirebaseInit()
{
StartCoroutine(FirebaseLoginCoroutine());
}
IEnumerator FirebaseLoginCoroutine()
{
yield return null;
Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
auth.SignInAnonymouslyAsync().ContinueWithOnMainThread(task =>
{
if (task.IsCanceled)
{
Debug.LogError("SignInAnonymouslyAsync was canceled.");
return;
}
if (task.IsFaulted)
{
Debug.LogError("SignInAnonymouslyAsync encountered an error: " + task.Exception);
return;
}
Firebase.Auth.FirebaseUser newUser = task.Result;
Debug.LogFormat("User signed in successfully: {0} ({1})",
newUser.DisplayName, newUser.UserId);
});
}
}
Api 참고
참고할만한 글
반응형
'개발 > Firebase' 카테고리의 다른 글
유니티 C# 파이어베이스 구글 로그인 간단 구현 Firebase Auth Google Login (0) | 2024.03.05 |
---|---|
유니티 C# 파이어베이스 클라우드 스토리지 Cloud Storage 간단 사용법 (0) | 2022.08.17 |
유니티 C# 파이어베이스 리더 보드 랭킹 Leaderboard 간단 구현법 (0) | 2022.08.17 |
유니티 C# 파이어베이스 데이터 저장, 불러오기 Save, Load 간단 사용법 데이터베이스 DataBase (0) | 2022.08.17 |
유니티 C# 파이어베이스 Crashlytics 간단 사용법 (0) | 2022.07.12 |
유니티 C# 파이어베이스 SDK 다운로드 Firebase Unity SDK (0) | 2022.07.12 |
유니티 C# 파이어베이스 애널리틱스 Firebase Analytics 간단 사용법 (0) | 2022.06.21 |
유니티 C# 파이어베이스 푸시알림 Firebase Cloud Messaging FCM 간단 사용법 (0) | 2022.06.20 |
댓글