ChangeToSocialMediaAccount
public BackndReturnObject ChangeToSocialMediaAccount(string federationToken, FederationType type);
Parameters
Value | Type | Description |
---|---|---|
federationToken | string | Federation access token |
type | FederationType(enum) | Federation type.FederationType.Google FederationType.Facebook FederationType.Apple FederationType.Steam FederationType.GPGS2 |
Description
This is a function for switching the customer ID in BACKND SDK to a federation account.
Once the custom account user logs in and calls the ChangeToSocialMediaAccount method, the user can be switched into a federation account.
For more information on federationToken and type required for ChangeToSocialMediaAccount, please refer to the federation authentication documentation.
If email permission was not added when switching a custom account into a federation account, the custom ID is displayed as the member ID.
Example
Synchronous
BackndReturnObject bro = Backnd.Player.ChangeToSocialMediaAccount("federationToken", FederationType.Google);
if(bro.IsSuccess())
{
Debug.Log("Login type changed successfully");
}
Asynchronous
Backnd.Player.ChangeToSocialMediaAccount("federationToken", FederationType.Google , callback => {
if(callback.IsSuccess())
{
Debug.Log("Login type changed successfully");
}
});
Return cases
Success cases
When the switching is successful
statusCode : 204
Error cases
When ChangeToSocialMediaAccount was completed but another attempt is made
statusCode : 400
errorCode : BadParameterException
When there is an attempt without CustomSignIn
statusCode : 400
errorCode : UndefinedParameterException
If the token value used in the federation switch was sent as null
statusCode : 400
errorCode : UndefinedParameterException
When there is an attempt to change the custom ID that is already signed up as a federation account
statusCode : 409
errorCode : DuplicatedParameterException