Login
[Shared by Player Network SDK and MSDK] Login to the specified channel.
Supported platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.Function Definition
- Unity
- Unreal Engine
void Login(string channel, string permissions = "", string subChannel = "", string extraJson = "{}");
static void Login(const std::string &channel, const std::string &permissions = "", const std::string &sub_channel = "", const std::string &extra_json = "{}");
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| channel | string | Name of the channel to log in to |
| permissions | string | List of authorized permissions, separated by commas For example: user_info,inapp_friends See the corresponding channel documentation for specific meanings |
| subChannel | string | Subchannel name For example: Facebook, Twitter, etc. |
| extraJson | string | Extended Fields For more information, refer to the corresponding channel documentation. |
| Parameters | Type | Description |
|---|---|---|
| channel | std::string | Name of the channel to log in |
| permissions | std::string | List of authorized permissions, separated by commas For example: user_info,inapp_friends See the corresponding channel documentation for specific meanings |
| sub_channel | std::string | Subchannel name For example: Facebook, Twitter, etc. |
| extra_json | std::string | Extended Fields For more information, refer to the corresponding channel documentation. |
Callback Handling
The callback handling interface is GUALoginResultObservers.The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
Callback event is LoginResultEvents. Callback ID is GUA_ACCOUNT_LOGIN.
Callback event is OnLoginResultNotify. Callback ID is kMethodIDAccountLogin.
Code Example
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().Login("WeChat");
GUA_NAMESPACE::GUAAccountService::Login("WeChat");