Bind
[Player Network SDK and MSDK] Links the third-party channel to the guest account. It ensures various third-party channels share a single Player Network SDK OpenID.
It is generally used to link Facebook or Google accounts to existing guest accounts in a game.
For more information, see MSDK link workflow.
Supported Platform
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.Function Definition
- Unity
- Unreal Engine
void Bind(string channel, string permissions = "", string subChannel = "", string extraJson = "{}");
static void Bind(const std::string &channel, const std::string &permissions = GUA_DEFAULT_EMPTY_STRING, const std::string &sub_channel = GUA_DEFAULT_EMPTY_STRING,
const std::string &extra_json = GUA_DEFAULT_JSON_STRING);
Input Parameters
- Unity
- Unreal Engine
| Parameter | Type | Description |
|---|---|---|
| channel | string | The specified channel to link. |
| permissions | string | The list of authorized permissions. Separate the permissions by commas.For example, "user_info,inapp_friends". |
| subChannel | string | Sub-channel name For example, "Facebook" or "Twitter". |
| extraJson | string | The extended field. For more information, see relative channel descriptions. |
| Parameter | Type | Description |
|---|---|---|
| Channel | std::string | The specified channel to link. |
| permissions | std::string | The list of authorized permissions. Separate the permissions by commas.For example, "user_info,inapp_friends". |
| sub_channel | std::string | Sub-channel name For example, "Facebook" or "Twitter". |
| extraJson | std::string | The extended field. For more information, see relative channel descriptions. |
Callback Processing
The callback processing API is GUALoginResultObservers. The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
The callback event is LoginResultEvents.
The callback methodID is GUA_ACCOUNT_BIND.
The callback event is OnLoginResultNotify.
The callback methodID is kMethodIDAccountBind.
Code Sample
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().Bind("WeChat");
GUA_NAMESPACE::GUAAccountService::Bind("WeChat");