Authentication error - Unity iOS
-
Hi all,
I've been trying out brainCloud as a replacement for Game Center turn based matching but I've run into a problem.
In my C# script I have a brainCloud Wrapper:
public BrainCloudWrapper brainCloudWrapper;when the singleton it is attached to is initiated it runs the following:
```brainCloudWrapper = gameObject.AddComponent<BrainCloudWrapper>();
brainCloudWrapper.Init();There is a simple button in a UI that calls the following: ``` brainCloudWrapper.AuthenticateAnonymous(successCallback = (response, cbObject) => { Debug.Log(string.Format("Success | {0}", response)); }, failureCallback = (status, code, error, cbObject) => { Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error)); });it runs in the editor but gives me:
Failed | 202 40206 {"status_message":"Processing exception (message): Credentials missing for Profile Id.","reason_code":40206,"status":202}
If I run it on my iPhone test device it causes a complete crash of the app with the following:
JsonTypeCoercionException: Only objects with default constructors can be deserialized. (BrainCloud.Internal.JsonResponseBundleV2) at BrainCloud.JsonFx.Json.TypeCoercionUtility.InstantiateObject (System.Type objectType, System.Collections.Generic.Dictionary`2[System.String,System.Reflection.MemberInfo]& memberMap) [0x00000] in <00000000000000000000000000000000>:0 at BrainCloud.JsonFx.Json.JsonReader.ReadObject (System.Type objectType) [0x00000] in <00000000000000000000000000000000>:0 at BrainCloud.JsonFx.Json.JsonReader.Deserialize[T] (System.String value) [0x00000] in <00000000000000000000000000000000>:0 at BrainCloud.Internal.BrainCloudComms.HandleResponseBundle (System.String jsonData) [0x00000] in <00000000000000000000000000000000>:0 at BrainCloud.Internal.BrainCloudComms.Update () [0x00000] in <00000000000000000000000000000000>:0 at BrainCloud.BrainCloudClient.Update (BrainCloud.eBrainCloudUpdateType in_updateType) [0x00000] in <00000000000000000000000000000000>:0Am I missing something from my setup, or in my code calls? it ran a few times without problem but seemed to generate a new user every time it ran which wasn't the expected behaviour (I assumed if it was same device it would use the already created anon. user)
Any help is much appreciated
-
I can see in the documentation that reason code 40206 is "MISSING_IDENTITY_ERROR" and that it suggests maybe trying forceCreate?
The iPhone crash is a bigger problem, as this can turn users away from the app pretty easily
-
Also getting the same error with "Sign In With Apple" when using the brainCloudWrapper.AuthenticateApple() method
-
Hi Gavin,
Did you resolve the crash issue on iOS? I am experiencing it as well, so I feel I must have missed something

Cheers,
Andreas
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login