Ejemplo n.º 1
0
        /// <summary>
        /// The Anonymous account authentication method
        /// for the sample application to use permissions of the authentication user.
        /// </summary>
        public async void Login()
        {
            AGConnectAuth        auth       = AGConnectAuth.Instance;
            Task <ISignInResult> signInTask = auth.SignInAnonymouslyAsync();

            try
            {
                await signInTask;

                if (signInTask.Result != null)
                {
                    // Sign in success.
                    Toast.MakeText(this, "Sign In success", ToastLength.Long).Show();
                }
                else
                {
                    // Sign in fail.
                    Toast.MakeText(this, "Sign In failed: " + signInTask.Exception.Message, ToastLength.Long).Show();
                }
            }
            catch (Exception e)
            {
                Log.Error(Tag, "sign in for agc failed: " + e.Message);
            }
        }