Ejemplo n.º 1
0
 void SwitchToCustomIdentityUser()
 {
     GetSocial.User.SwitchUser(
         AuthIdentity.CreateCustomIdentity(CustomProviderId, _customUserId, _customProviderToken),
         () =>
     {
         _console.LogD("Successfully switched to Custom provider user");
         demoController.FetchCurrentUserData();
     },
         error => _console.LogE("Switching to custom provider user failed, reason: " + error));
 }
Ejemplo n.º 2
0
 void AddCustomUserIdentity()
 {
     GetSocial.User.AddAuthIdentity(
         AuthIdentity.CreateCustomIdentity(CustomProviderId, _customUserId, _customProviderToken),
         () =>
     {
         _console.LogD("Successfully added custom identity");
         demoController.FetchCurrentUserData();
     },
         error => _console.LogE(string.Format("Failed to add user identity '{0}', reason: {1}", CustomProviderId,
                                              error)),
         OnAddUserIdentityConflict);
 }
Ejemplo n.º 3
0
        private void OnGetSocialInitialized()
        {
            var user         = FirebaseAuth.DefaultInstance.CurrentUser;
            var token        = Cyphering.GetHashByKey(Credentials.HASH_SECRET, user.UserId);
            var authIdentity = AuthIdentity.CreateCustomIdentity(user.ProviderId, user.UserId, token);

            GetSocial.User.AddAuthIdentity(authIdentity, SetGetSocialNameAndAvatar,
                                           error => { Utils.ShowMessage("News Feed Login Failed"); },
                                           conflict =>
            {
                GetSocial.User.SwitchUser(authIdentity,
                                          SetGetSocialNameAndAvatar,
                                          error => { Utils.ShowMessage("News Feed Login Failed"); });
            });
        }