Hello,
I have recently upgraded to the latest playfab unity sdk from GitHub:
https://github.com/PlayFab/UnitySDK
The registration now throws error about usersettings being null.
I have looked into the new registration code in PlaFabWWW.cs and found some wrong code and fixed it, but i'm not sure if I messed up with something. Here's the code that I have changed to fix it:
#if !DISABLE_PLAYFABCLIENT_API
UserSettings userSettings = null;
var res = result as LoginResult;
var regRes = result as RegisterPlayFabUserResult;
if (res != null) {
userSettings = res.SettingsForUser;
AuthKey = res.SessionTicket;
} else if (regRes != null) {
userSettings = regRes.SettingsForUser; // Change res to regRes
AuthKey = regRes.SessionTicket;
}
if (userSettings != null) {
//AuthKey = res.SessionTicket; // Commented this for it has already been instantiated above and throwing errors if it is registration
#region TrackIDFA...
#endregion
}
#endif
This has made it work properly so far, but is this how it is supposed to be? or does this mess up the part inside the userSettings' if condition?
Thank you