Is it possible to find out if the account is anonymous or recoverable after I used LoginWithIOSDeviceID or LoginWithAndroidDeviceID to log in to that account?
Is it possible to find out if the account is anonymous or recoverable after I used LoginWithIOSDeviceID or LoginWithAndroidDeviceID to log in to that account?
If you want to access linked accounts information, you may call client API GetPlayerProfile meanwhile add profile constraints in the request like:
{ "ProfileConstraints": { "ShowLinkedAccounts":true } }
However, you need to make sure the option "Linked accounts" in "ALLOW CLIENT ACCESS TO SENSITIVE PROFILE PROPERTIES" is checked in [Game manager] -> [title settings] -> [Client Profile Options].
However, since it is sensitive information, we'd suggest not to check it. You may implement corresponding server API in cloud Script.
Is it possible to get the linked accounts information with the API GetPlayerProfile in CloudScript or how can I get this information in CloudScript? I want to show a message in my game if the account is anonymous or recoverable.
Yes, you may implement server API GetPlayerProfile in Cloud Script. Moreover, you may keep the verification process in Cloud Script and only return Boolean variable.
I get a JavascriptException in my CloudScript. How can I check if the player's account is recoverable?
"StackTrace": "ReferenceError: IsAccountRecoverable is not defined\n at handlers.IsAccountRecoverable (BFD0A-main.js:751:38)\n at Object.invokeFunction (Script:116:33)"
handlers.IsAccountRecoverable = function (args, context) { var CurrentAccount = ""; var resultprofile = server.GetPlayerProfile( { PlayFabID: currentPlayerId, ProfileConstraints : { ShowLinkedAccounts: true } }); if (resultprofile.Error == null) { if (resultprofile.PlayerProfile != null) { CurrentAccount = resultprofile.PlayerProfile.LinkedAccounts; if (CurrentAccount != null) { if (CurrentAccount == IsAccountRecoverable) { log.info("Your account is recoverable."); return "true"; } else { log.info("Your account is not recoverable."); return "false"; } } else log.info("Not possible to get account information."); } } }
3 People are following this question.