Hello,
I am trying to request the Title Display Name for a username using the following call:
PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest(), OnGetUsernameResult, OnGetUsernameError);
This is called after a successful Apple Sign In using the following call and within the success callback function (OnPlayfabAppleAuthCompleteFirstTime):
PlayFabClientAPI.LoginWithApple(new LoginWithAppleRequest { CreateAccount = true, IdentityToken = args.userInfo.idToken }, OnPlayfabAppleAuthCompleteFirstTime, OnPlayfabAppleAuthFailed);
Please note, Apple Sign In works currently in our live app (ID: 3476A) and we are trying to implement a simple fetch of the Title Display Name for the user.
However, I am getting an error/crash when the PlayFabClientAPI.GetAccountInfo call is made with the following error. It appears the Apple enum is missing or something from the platform list or something?
Thanks for your help!
---------
Uploading Crash Report
ArgumentException: Requested value 'Apple' was not found.
at System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) [0x00000] in <00000000000000000000000000000000>:0
at System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) [0x00000] in <00000000000000000000000000000000>:0
at System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Json.PlayFabSimpleJson.DeserializeObject[T] (System.String json, PlayFab.Json.IJsonSerializerStrategy jsonSerializerStrategy) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Internal.PlayFabHttp+<>c__DisplayClass23_0`1[TResult].<_MakeApiCall>b__0 () [0x00000] in <00000000000000000000000000000000>:0
at System.Action.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Internal.PlayFabUnityHttp.OnResponse (System.String response, PlayFab.Internal.CallRequestContainer reqContainer) [0x00000] in <00000000000000000000000000000000>:0
at PlayFab.Internal.PlayFabUnityHttp+<Post>d__12.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0
PlayFab.Internal.<Post>d__12:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Couple other comments.
-PlayFabClientAPI.GetAccountInfo() function call crashes and neither of the success/failure callback functions are called when logged in through Apple Sign In
-Dev environment is Unity 2019.4.9f1
-Playfab SDK 2.82.200303
Please use postman to call GetAccountInfo, get GetAccountInfoResult and send json to us.Please note that hide sensitive and private information.
Answer by Ivan Cai · Mar 04, 2021 at 09:10 AM
Since your playfab sdk version is relatively old, there is no enum corresponding to Apple. Please update to the latest version.
This is the enum of your current sdk:
public enum UserOrigination { Organic, Steam, Google, Amazon, Facebook, Kongregate, GamersFirst, Unknown, IOS, LoadTest, Android, PSN, GameCenter, CustomId, XboxLive, Parse, Twitch, WindowsHello, ServerCustomId, NintendoSwitchDeviceId, FacebookInstantGamesId, OpenIdConnect }
This is the enum of the latest sdk:
public enum UserOrigination { Organic, Steam, Google, Amazon, Facebook, Kongregate, GamersFirst, Unknown, IOS, LoadTest, Android, PSN, GameCenter, CustomId, XboxLive, Parse, Twitch, WindowsHello, ServerCustomId, NintendoSwitchDeviceId, FacebookInstantGamesId, OpenIdConnect, Apple, NintendoSwitchAccount }
Link Steam account - 400 Unavailable 1 Answer
Existing GooglePlay login created a new account 1 Answer
No callbacks from LoginWithAndroidDeviceID? 5 Answers
Login with Facebook on iOS is creating a different playfab account 7 Answers
New Account created when success login with another account 1 Answer