public FirebaseAuther auth()
        {
            if (initCB.isDone())
            {
                return(this);
            }
            FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;

            auth.SignInWithEmailAndPasswordAsync(email, pass).ContinueWith(task => {
                if (task.IsCanceled)
                {
                    Debug.LogError("CreateUserWithEmailAndPasswordAsync was canceled.");
                    return;
                }
                if (task.IsFaulted)
                {
                    Debug.LogError("CreateUserWithEmailAndPasswordAsync encountered an error: " + task.Exception);
                    return;
                }

                user = task.Result;
                UnityMainThreadDispatcher.uniRxRun(() => {
                    initCB.done();
                    Debug.Log("auth.done");
                });
                Debug.LogFormat("Firebase user login successfully: {0} ({1})",
                                user.DisplayName, user.UserId);
            });
            return(this);
        }
Пример #2
0
        private void onOpened(object sender)
        {
            var connectString = StompString("CONNECT", new Dictionary <string, string>()
            {
                { "accept-version", acceptVersion },
                { "heart-beat", heartBeat }
            });

            websocket.Send(connectString);
            Debug.Log("WebSocket connect...... " + sender);
            connectedDone.done();
        }