Bind
[Shared by Player Network SDK and MSDK] Bind a third-party channel to a guest account.It essentially means that multiple third-party accounts share a single Player Network SDK OpenID.
Typical use case: a player logs in as a guest and then binds a Facebook or Google account.
For more information, see MSDK Binding Flow.
Supported platforms
- 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
| Parameters | Type | Description |
|---|---|---|
| channel | string | Channel to bind |
| permissions | string | Permission list when binding, multiple permissions separated by commas For example: user_info,inapp_friends |
| subChannel | string | Sub-channel name For example "Facebook" or "Twitter". |
| extraJson | string | Extended fields For more information, seethe relative channel descriptions. |
| Parameters | Type | Description |
|---|---|---|
| Channel | std::string | Channel to bind |
| permissions | std::string | Permission list when binding, multiple permissions separated by commas For example: user_info,inapp_friends |
| sub_channel | std::string | Sub-channel name For example "Facebook" or "Twitter". |
| extraJson | std::string | Extended Fields For more information, refer to the corresponding channel documentation. |
Callback Handling
The callback processing interface is GUALoginResultObservers.The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
Callback event is LoginResultEvents. Callback ID is GUA_ACCOUNT_BIND.
Callback event is OnLoginResultNotify. Callback ID is kMethodIDAccountBind.
Code Example
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().Bind("WeChat");
GUA_NAMESPACE::GUAAccountService::Bind("WeChat");