Exemple #1
0
 // Spawns firebase and verifies that it is updated.
 private void Awake()
 {
     dependencyStatus = DependencyStatus.UnavailableOther;
     if (spawned == false)
     {
         spawned = true;
         DontDestroyOnLoad(gameObject);
         FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
             dependencyStatus = task.Result;
             if (dependencyStatus == DependencyStatus.Available)
             {
                 FirebaseApp app = FirebaseApp.DefaultInstance;
                 app.SetEditorDatabaseUrl("https://lootbox-b9a5e.firebaseio.com/");
                 if (app.Options.DatabaseUrl != null)
                 {
                     app.SetEditorDatabaseUrl(app.Options.DatabaseUrl);
                 }
                 databaseReference = FirebaseDatabase.DefaultInstance.RootReference;
                 isInitialized     = true;
                 InitializeFirebase();
             }
             else
             {
                 Debug.LogError(string.Format(
                                    "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
             }
         });
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Exemple #2
0
    // Start is called before the first frame update
    void Start()
    {
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            var dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                //   app = Firebase.FirebaseApp.DefaultInstance;

                // Set a flag here to indicate whether Firebase is ready to use by your app.
            }
            else
            {
                UnityEngine.Debug.LogError(System.String.Format(
                                               "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
                // Firebase Unity SDK is not safe to use here.
            }
        });

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(continuationAction: task =>
        {
            FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
        });
    }
Exemple #3
0
    private void Start()
    {
        DontDestroyOnLoad(gameObject);

        // Initialize Firebase
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                // Crashlytics will use the DefaultInstance, as well;
                // this ensures that Crashlytics is initialized.
                FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
                Crashlytics.IsCrashlyticsCollectionEnabled = true;

                // this ensures that Crashlytics and Analytics is initialized.
                var firebaseApp = FirebaseApp.DefaultInstance;

                // Set a flag here for indicating that your project is ready to use Firebase.
                FirebaseAnalytics.LogEvent(Actions.APP_OPEN);

                // Set a flag here for indicating that your project is ready to use Firebase.
            }
            else
            {
                Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}");
                // Firebase Unity SDK is not safe to use here.
            }
        });
    }
 // Use this for initialization
 void Start()
 {
     //Firebase.Leaderboard.FirebaseInitializer.Initialize(dependencyStatus => {
     //    if (dependencyStatus == DependencyStatus.Available)
     //    {
     //        Debug.Log("Firebase database ready.");
     //        AnonSignIn();
     //        readyToInitialize = true;
     //    }
     //    else
     //    {
     //        Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
     //    }
     //});
     FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
         dependencyStatus = task.Result;
         if (dependencyStatus == DependencyStatus.Available)
         {
             Debug.Log("Dependency Status Available");
         }
         else
         {
             Debug.LogError(
                 "Could not resolve all Firebase dependencies: " + dependencyStatus);
         }
     });
 }
    // Use this for initialization
    void Start()
    {
        leaderBoard = new ArrayList();
        leaderBoard.Add("Firebase Top " + MaxScores.ToString() + " Scores");

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });

        ///////////////////////////////


        dataController   = FindObjectOfType <DataController>();
        currentRoundData = dataController.GetCurrentRoundData();
        questionPool     = currentRoundData.questions;
        timeRemaining    = currentRoundData.timeLimitInSeconds;
        UpdateTimeRemainingDisplay();

        playerScore_LD = 0;
        playerScore_RR = 0;
        questionIndex  = 0;

        ShowQuestion();
        isRoundActive = true;
    }
Exemple #6
0
    void Awake()
    {
        DontDestroyOnLoad(this.gameObject);

        // Check Firebase Dependencies before initializing Firebase
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            if (task.IsCompleted)
            {
                Debug.Log("Firebase Dependencies check completed");
                if (task.Result == DependencyStatus.Available)
                {
                    // Set up the Editor before calling into the realtime database.
                    FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://marvellous-kittens.firebaseio.com/");
                    // Get the root of the database
                    _reference         = FirebaseDatabase.DefaultInstance.RootReference;
                    auth               = FirebaseAuth.DefaultInstance;
                    auth.StateChanged += AuthStateChanged;
                    AuthStateChanged(this, null);
                    Debug.Log("Firebase Initialized");
                }
                else
                {
                    Debug.Log("Could not resolve all Firebase Dependencies");
                }
            }
            else
            {
                Debug.Log("Dependency check not completed");
            }
        });
    }
Exemple #7
0
        protected virtual void Start()
        {
            // handles loading screen on application start
            if (GameObject.Find("Img_Loading") != null)
            {
                loadingGO = GameObject.Find("Img_Loading");
            }

            FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = task.Result;

                if (dependencyStatus == DependencyStatus.Available)
                {
                    InitializeFirebase();
                    syncEstablished = true;
                }
                else
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);

                    syncEstablished = true;
                    gameObject.GetComponent <MainMenuButtons>().OpenError("Connection Failed!",
                                                                          "Error occured! " + dependencyStatus);
                }
            });
        }
    // =========================================================================================================================

    protected override void OnMakeSingleton(out bool bIsGenearteGameObject, out bool bIsUpdateAble)
    {
        base.OnMakeSingleton(out bIsGenearteGameObject, out bIsUpdateAble);

        bIsUpdateAble = true;
        p_bIsInit     = false;
        p_Event_OnFinish_Initailizing.DoNotify(false);

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp, i.e.
                //   app = Firebase.FirebaseApp.DefaultInstance;
                // where app is a Firebase.FirebaseApp property of your application class.

                // Set a flag here indicating that Firebase is ready to use by your
                // application.

                // _pFirebaseDataBase = FirebaseDatabase.DefaultInstance;
            }
            else
            {
                UnityEngine.Debug.LogError(System.String.Format(
                                               "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
                // Firebase Unity SDK is not safe to use here.
            }

            p_bIsInit = true;
            p_Event_OnFinish_Initailizing.DoNotify(true);
        });

        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl(p_strDB_URL);
    }
Exemple #9
0
    public void InitializeFirebase()
    {
        Debug.Log("Setting up Firebase Auth");

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                app  = FirebaseApp.DefaultInstance;
                auth = FirebaseAuth.DefaultInstance;
                InitFirebaseDatabase();
                auth.StateChanged += AuthStateChanged;
                AuthStateChanged(this, null);
                // Set a flag here to indicate whether Firebase is ready to use by your app.
            }
            else
            {
                Debug.LogError(string.Format(
                                   "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
                // Firebase Unity SDK is not safe to use here.
            }
        });
    }
 private void Awake()
 {
     manager = GetComponent <UIManager>();
     FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread <DependencyStatus>((task) =>
     {
         DependencyStatus status = task.Result;
         if (status == DependencyStatus.Available)
         {
             App               = FirebaseApp.DefaultInstance;
             Auth              = FirebaseAuth.DefaultInstance;
             functions         = FirebaseFunctions.DefaultInstance;
             functionReference = functions.GetHttpsCallable("RequestMessage");
             manager.TurnOff(manager.AuthBlocker);
             manager.TurnOff(manager.AnalyticsBlocker);
             App.SetEditorDatabaseUrl("https://fir-n-ix.firebaseio.com/");
             dbReference = FirebaseDatabase.DefaultInstance.RootReference;
             FirebaseMessaging.TokenReceived   += OnTokenReceived;
             FirebaseMessaging.MessageReceived += OnMessageReceived;
             FirebaseMessaging.TokenRegistrationOnInitEnabled = true;
             defaults.Add("RemoteTest", 25);
             FirebaseRemoteConfig.SetDefaults(defaults);
             FirebaseRemoteConfig.FetchAsync(TimeSpan.Zero).ContinueWithOnMainThread((remoteConfigTask) =>
             {
                 FirebaseRemoteConfig.ActivateFetched();
                 RemoteConfigResult = FirebaseRemoteConfig.GetValue("RemoteTest").StringValue;
                 manager.TurnOff(manager.RemoteConfigBlocker);
             });
             storage = FirebaseStorage.DefaultInstance;
         }
         else
         {
             Debug.Log(string.Format("Can't resolve all Firebase dependencies: {0}", status));
         }
     });
 }
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(this);

            FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
                var dependencyStatus = task.Result;
                if (dependencyStatus == DependencyStatus.Available)
                {
                    _ready = false;
                    FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://auispeechvr-93119.firebaseio.com/");
                    _question = new Queue <string>();
                }
                else
                {
                    //TODO Don't allow to do anything
                    Console.WriteLine("ERROR");
                    Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}");
                }
            });
        }
        else
        {
            Destroy(this);
        }
    }
Exemple #12
0
    void Initialization()
    {
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl(FirebaseDBURL);

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                usersDatabase           = FirebaseDatabase.DefaultInstance.GetReference("Users");
                roomsDatabase           = FirebaseDatabase.DefaultInstance.GetReference("Rooms");
                invitesDatabase         = FirebaseDatabase.DefaultInstance.GetReference("Invites");
                acceptedInvitesDatabase = FirebaseDatabase.DefaultInstance.GetReference("AcceptedInvites");

                if (auth.auth.CurrentUser != null)
                {
                    auth.AutoLogin(auth.auth.CurrentUser.UserId);
                }
                else
                {
                    SceneManager.LoadScene("Login");
                }
            }
            else
            {
                Debug.LogError(String.Format(
                                   "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
            }
        });
    }
    void Start()
    {
        // Set this before calling into the realtime database.
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://quiz-guarani.firebaseio.com/");


        // Get the root reference location of the database.
        DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;

        leaderBoard.Clear();
        leaderBoard.Add("Firebase Top " + MaxScores.ToString() + " Teste");

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });
    }
 private void FirebaseInit()
 {
     FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
         var dependencyStatus = task.Result;
         if (dependencyStatus == Firebase.DependencyStatus.Available)
         {
             // Set a flag here indiciating that Firebase is ready to use by your application.
             Debug.Log("Firebase ready!");
             FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://mathballs-0000.firebaseio.com/");
             this.reference = FirebaseDatabase.DefaultInstance.RootReference;
             // Read data
             FirebaseDatabase.DefaultInstance
             .GetReference("hiscore")
             .GetValueAsync().ContinueWith(task1 => {
                 if (task1.IsFaulted)
                 {
                     // Handle the error...
                 }
                 else if (task1.IsCompleted)
                 {
                     this.snapshot = task1.Result;
                     // Do something with snapshot...
                     this.strSnapshot = this.snapshot.GetRawJsonValue();
                 }
             });
         }
         else
         {
             UnityEngine.Debug.LogError(System.String.Format(
                                            "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
             // Firebase Unity SDK is not safe to use here.
         }
     });
 }
Exemple #15
0
    private Task TestApp(string infoPath)
    {
        var info    = Resources.Load <TextAsset>(infoPath).text;
        var options = AppOptions.LoadFromJsonConfig(info);
        var app     = FirebaseApp.Create(options, infoPath);

        return(FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(dependencies =>
        {
            if (dependencies.Result == DependencyStatus.Available)
            {
                var remoteConfig = Firebase.RemoteConfig.FirebaseRemoteConfig.GetInstance(app);

                remoteConfig.FetchAsync(TimeSpan.Zero)
                .ContinueWithOnMainThread(fetch =>
                {
                    remoteConfig.ActivateAsync()
                    .ContinueWithOnMainThread(activation =>
                    {
                        var value = remoteConfig.GetValue("parameter").StringValue;
                        Debug.Log($"Firebase app name: {remoteConfig.App.Name}. Parameter variable: {value}");
                    });
                });
            }
        }));
    }
Exemple #16
0
    protected virtual void Start()
    {
        modelList.Clear();
        modelList.Add("First");
        audioList.Clear();
        audioList.Add("First");
        longTextList.Clear();
        longTextList.Add("First");
        imageList.Clear();
        imageList.Add("First");

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
            }
            else
            {
                Debug.LogError(
                    "Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });
    }
Exemple #17
0
    // Start is called before the first frame update
    void Start()
    {
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                //   app = Firebase.FirebaseApp.DefaultInstance;

                // Set a flag here to indicate whether Firebase is ready to use by your app.
            }
            else
            {
                Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}");
                // Firebase Unity SDK is not safe to use here.
            }
        });

        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://realtimedatebasetest.firebaseio.com/");
        _database     = FirebaseDatabase.DefaultInstance.GetReference("userData");
        _playerNumber = 3;

        _database.ValueChanged += HandleValueChanged;

        Load();
    }
Exemple #18
0
        public IEnumerator InitAuthAsync()
        {
            _elapsedTime = 0;

            var task = FirebaseApp.CheckAndFixDependenciesAsync();

            yield return(new WaitWhile(() => IsTask(task.IsCompleted)));

            if (!task.IsCompleted)
            {
                Debug.LogError("ERROR" + task.Exception);
                yield break;
            }

            if (task.IsCanceled || task.IsFaulted)
            {
                Debug.LogError("ERROR" + task.Exception);
                yield break;
            }

            _dependencyStatus = task.Result;

            if (_dependencyStatus == DependencyStatus.Available)
            {
                Debug.Log("Firebase initializing...");
                InitAuth();
            }
            else
            {
                Debug.LogError("Could not resolve all Firebase dependencies: " + _dependencyStatus);
            }
        }
Exemple #19
0
 // Start is called before the first frame update
 void Start()
 {
     FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
     {
         FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
     });
 }
Exemple #20
0
    // 초기화
    public void Awake()
    {
        // 상태 비활성화
        signInButton.interactable = false;
        errorPanel.SetActive(false);
        IsSignInOnProgress = false;

        // Firebase 사용 가능한지 확인(Async메서드가 아니기 때문에 callback, chain 필요 --> ContinueWith로 chain 걸어주기)
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var result = task.Result;

            if (result != DependencyStatus.Available)
            {
                Debug.LogError("Firebase is not available: " + result.ToString());
                IsFirebaseReady = false;
            }
            else
            {
                Debug.Log("Firebase is ready now.");
                IsFirebaseReady = true;

                firebaseApp  = FirebaseApp.DefaultInstance;
                firebaseAuth = FirebaseAuth.DefaultInstance;
            }

            signInButton.interactable = IsFirebaseReady;
        }
                                                                );
    }
Exemple #21
0
    void Awake()
    {
        //Check that all of the necessary dependencies for Firebase are present on the system
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                //If they are avalible Initialize Firebase
                InitializeFirebase();
            }
            else
            {
                Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });

        if (this != instance)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }
Exemple #22
0
    void Awake()
    {
        instance  = this;
        connected = false;
        //Check that all of the necessary dependencies for Firebase are present on the system
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                //If they are avalible Initialize Firebase
                InitializeFirebase();
            }
            else
            {
                Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });

        var obj = FindObjectsOfType <FirebaseManager>();

        if (obj.Length == 1)
        {
            DontDestroyOnLoad(gameObject);
        }

        else
        {
            Destroy(gameObject);
        }
    }
 public void ButtonLogin()
 {
     if (TestEmail.IsEmail(inputFieldEmail.text) && inputFieldEmail.text != "" && inputFieldPassword.text != "" && inputFieldEmail.text != " " && inputFieldPassword.text != " ")
     {
         if (Application.internetReachability == NetworkReachability.NotReachable)
         {
             textWarning.text = "Error. Check internet connection!";
         }
         else
         {
             panelLoading.SetActive(true); ok = true;
             FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
             {
                 if (task.Result == DependencyStatus.Available)
                 {
                     InitializeFirebase();
                 }
                 else
                 {
                     Debug.LogError(
                         "Could not resolve all Firebase dependencies: " + task.Result);
                 }
             });
         }
     }
     else
     {
         textWarning.color = Color.red;
         textWarning.text  = "Please Check Your Email Or Password";
     }
 }
        private void Start()
        {
            /// Check firebase dependencies are all in order
            FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = task.Result;
                if (dependencyStatus == DependencyStatus.Available)
                {
                    //init firebase
                    InitializeFirebase();
                }
                else
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });

            /*
             * FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://fir-iosstoragetutorial.firebaseio.com/");
             * //db  = FirebaseDatabase.DefaultInstance.GetReference("scores");
             * db = FirebaseDatabase.DefaultInstance.GetReference("ARdata");
             *
             * db.ValueChanged += HandleValueChanged;
             */
            //GetTopScore();
        }
    void Init()
    {
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://proje-29618.firebaseio.com/");

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                parkReference   = FirebaseDatabase.DefaultInstance.GetReference("park");
                arabaReference  = FirebaseDatabase.DefaultInstance.GetReference("araba");
                seciliReference = FirebaseDatabase.DefaultInstance.GetReference("secili");

                parkReference.ValueChanged   += parkVeriDegisti;
                arabaReference.ValueChanged  += aracVeriDegisti;
                seciliReference.ValueChanged += seciliAracDegisti;

                Debug.Log("Bağlantı başarılı");
            }
            else
            {
                Debug.Log("Bağlantı başarısız");
            }
        }

                                                                );
    }
Exemple #26
0
    /// <summary>
    /// Initialize database.
    /// </summary>
    public static void InitDatabase()
    {
        // Check dependencies.
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            // Cache Status.
            var dependencyStatus = task.Result;

            // Firebase available?
            if (dependencyStatus == DependencyStatus.Available) // Yes.
            {
                // Output successful.
                Debug.Log("Firebase available!");

                // Set Firebase instance.
                FirebaseApp.DefaultInstance.SetEditorDatabaseUrl(DATABASE_URL);
                ConnectionReference = FirebaseDatabase.DefaultInstance.RootReference;

                // ToDo: Get the last id.
                ServerManager.GetTableValues();
            }
            else // No.
            {
                // Output error.
                Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}!");

                // Quit software, because Firebase can't be used.
                Application.Quit();
            }
        });
    }
Exemple #27
0
    // Databese bağlantı işlemi
    void Initialization()
    {
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                usersReference = FirebaseDatabase.DefaultInstance.GetReference("Users");

                // Bağlantı kurulduktan sonra gerekli işlemler
                Debug.Log("DB Bağlantısı Kuruldu.");

                // SaveData("Onur", 15, true);
                // UpdateData("-MJktgR-g6aLW_z7cfJB", "İsmail Onur", 8, false);
                // GetUserList();
                // DeleteUser("-MJlE6HNMKc0tmzid5Hp");

                // Listener ile odayı dinleme
                string userId = "-MJlG5U-5YZuElbUzqka";
                usersReference.Child(userId).ValueChanged += GetUserDetails;
            }
            else
            {
                Debug.LogError(System.String.Format("Hata {0}", dependencyStatus));
            }
        });
    }
    void Initialization()
    {
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                Debug.Log("Db connection is success");

                usersDatabase           = FirebaseDatabase.DefaultInstance.GetReference("Users");
                roomsDatabase           = FirebaseDatabase.DefaultInstance.GetReference("Rooms");
                invitesDatabase         = FirebaseDatabase.DefaultInstance.GetReference("Invites");
                acceptedInvitesDatabase = FirebaseDatabase.DefaultInstance.GetReference("AcceptedInvites");

                if (auth.auth.CurrentUser != null)
                {
                    auth.AutoLogin(auth.auth.CurrentUser.UserId);
                }
                else
                {
                    SceneManager.LoadScene("LoginScene");
                }
            }
            else
            {
                Debug.LogError($"DbConnectionError {dependencyStatus}");
            }
        });
    }
Exemple #29
0
    private void Start()
    {
        //클릭 못하게
        signInBtn.interactable = false;

        //firebase를 구동할 수 있는 환경인지 체크
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
        {
            var result = task.Result;

            //구동 불가라면
            if (result != DependencyStatus.Available)
            {
                Debug.LogError(result.ToString());
                IsFirebaseReady = false;
            }
            else
            {
                IsFirebaseReady = true;

                //firebase앱의 전체적인 기능을 관리하는 오브젝트를 가져옴
                firebaseApp  = FirebaseApp.DefaultInstance;
                firebaseAuth = FirebaseAuth.DefaultInstance;
                // firebaseAuth = FirebaseAuth.GetAuth(firebaseapp); 과 같다
            }

            signInBtn.interactable = IsFirebaseReady;
        });
    }
    // Use this for initialization
    void Start()
    {
        FirebaseApp.CheckAndFixDependenciesAsync();

        // Set up the Editor before calling into the realtime database.
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://card-677f1.firebaseio.com/");
    }