Skip to main content
Version: 5.17.0

ChangeCustomToFederation

public BackendReturnObject ChangeCustomToFederation(string federationToken, FederationType type);

Parameters

ValueTypeDescription
federationTokenstringFederation access token
typeFederationType(enum)Federation type.
FederationType.Google
FederationType.Facebook
FederationType.Apple
FederationType.Steam
FederationType.GPGS2

Description

This is a function for switching the custom ID in BACKND SDK to a federation account.\ Once the custom account user logs in and calls the ChangeCustomToFederation method, the user can be switched into a federation account.\ For more information on federationToken and type required for ChangeCustomToFederation, 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

BackendReturnObject bro = Backend.BMember.ChangeCustomToFederation("federationToken", FederationType.Google);
if(bro.IsSuccess())
{
Debug.Log("Login type changed successfully");
}

Asynchronous

Backend.BMember.ChangeCustomToFederation("federationToken", FederationType.Google , callback => {
if(callback.IsSuccess())
{
Debug.Log("Login type changed successfully");
}
});

SendQueue

SendQueue.Enqueue(Backend.BMember.ChangeCustomToFederation,  "federationToken", FederationType.Google, callback => {
if(callback.IsSuccess())
{
Debug.Log("Login type changed successfully");
}
});

ReturnCase

Success cases

When the switching is successful\ statusCode : 204\ message : Success

Error cases

When ChangeCustomToFederation was completed but another attempt is made\ statusCode : 400\ errorCode : BadParameterException\ message : bad type, Invalid type

When the attempt was made without doing customLogin\ statusCode : 400\ errorCode : UndefinedParameterException\ message : undefined access_token, access_token cannot be checked

When the token value used to switch to federation account was sent as null\ statusCode : 400\ errorCode : UndefinedParameterException\ message : undefined federation_access_token, federation_access_token cannot be checked

When there is an attempt to change the custom ID that is already signed up as a federation account\ statusCode : 409\ errorCode : DuplicatedParameterException\ message : Duplicated federationId, Duplicated federationId