question

bbekec avatar image
bbekec asked

Some Accounts Stuck When adding Facebook email Address

Hello, in my game, I m creating accounts with Facebook.

At most of players there are no problems but some email me about stucking while they are trying to login.

My login type like this;

// First initializng Facebook

// After Facebook login with permission name and email
// Getting FB name and email of player
FB.API("/me?fields=name,email", HttpMethod.GET,
                fbIsimBasari =>
                {
//getting Facebook name succesfull
// Playfab call for login. If there is no account I m creating new account in another function

PlayFabClientAPI.LoginWithFacebook(new LoginWithFacebookRequest { CreateAccount = false, AccessToken = AccessToken.CurrentAccessToken.TokenString },
                                        LWFSonucBasari =>
{
	PlayFabClientAPI.AddOrUpdateContactEmail(new AddOrUpdateContactEmailRequest { EmailAddress = fbIsimBasari.ResultDictionary["email"].ToString() },
                               emailSuccess =>
                               {
                                   string facebookIsmi = fbIsimBasari.ResultDictionary["name"].ToString();
                                   if (facebookIsmi.Length > 25)
                                   {
                                       facebookIsmi = facebookIsmi.Substring(0, 25);
                                   }
                                   PlayFabClientAPI.UpdateUserTitleDisplayName(new UpdateUserTitleDisplayNameRequest { DisplayName = facebookIsmi },
                                       dispNameSuccess =>
                                       {
                                           if (GameObject.Find("DurumText")) GameObject.Find("DurumText").GetComponent<Text>().text = SelectLanguage.Instance.PFCihazBaglaniyor;
#if UNITY_ANDROID
                                                       PlayFabClientAPI.LinkAndroidDeviceID(new LinkAndroidDeviceIDRequest { AndroidDeviceId = ReturnMobileID(), ForceLink = true },
                                                               LoginMobileSuccess =>
                                               {
                                                   if (GameObject.Find("DurumText")) GameObject.Find("DurumText").GetComponent<Text>().text = "Android Cihaz Kaydı Başarılı.\nPhoton Bağlanıyor...";
                                                   PhotonLogin();
                                               },
                                                               LoginMobileError =>
                                               {
                                                   if (GameObject.Find("DurumText")) GameObject.Find("DurumText").GetComponent<Text>().text = "Playfab - Android Cihaz Kaydı Başarısız!";
                                               });
#endif
#if UNITY_IOS
                                               PlayFabClientAPI.LinkIOSDeviceID(new LinkIOSDeviceIDRequest { DeviceId = ReturnMobileID(), ForceLink = true },
                                                                                          LoginMobileSuccess =>
                                                                                          {
                                                                                              if (GameObject.Find("DurumText")) GameObject.Find("DurumText").GetComponent<Text>().text = "IOS Cihaz Kaydı Başarılı.\nPhoton Bağlanıyor...";
                                                                                              PhotonLogin();
                                                                                          },
                                                                                          LoginMobileError =>
                                                                                          {
                                                                                              if (GameObject.Find("DurumText")) GameObject.Find("DurumText").GetComponent<Text>().text = "Playfab - IOS Cihaz Kaydı Başarısız!";
                                                                                          });
#endif
                                                   },
                                       dispNameError =>
                                       {
                                           if (GameObject.Find("DurumText")) GameObject.Find("DurumText").GetComponent<Text>().text = "Playfab - Görünen İsim Kaydı Başarısız!";
                                       });
                               },
                               emailError =>
                               {
                                   if (GameObject.Find("DurumText")) GameObject.Find("DurumText").GetComponent<Text>().text = "Playfab - E-Posta Kaydı Başarısız!";
                               });

}
, LWFSonucBasarisiz =>
{

});
});
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JayZuo avatar image JayZuo ♦ commented ·

What's the error message your player got? Your code looks good, however, it seems you didn't handle the error callback of LoginWithFacebook method. With the error details, we can then help you to see why your player was stuck.

0 Likes 0 ·

1 Answer

·
bbekec avatar image
bbekec answered

Hello Jay Zuo,

Thanks for your reply.

I see that In my complete code, there are some unnecessary codes. I will clean them and i will make a regulation again and as you said that there are no error callbacks. I will add them too. Then i will publish a new version of the game. If problem still exist i will ask for help again.

Thanks a lot

Regards

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.