ChannelPermissionAuth [MSDK Only]
[MSDK Only] MSDK encapsulates the authorization interface for WeChat Channels. Apps call ChannelPermissionAuth
, pass snsapi_channels_livestream
to WeChat, and get tdiAuthBuffer
from MSDK callback for logging in to the livestream. This feature does not restrict the login channel and state, so it is available across platforms.
note
- Currently only supports WeChat Channels.
- Currently passes
snsapi_channels_livestream
for the permission list. This label differentiates between normal login and permission request. The requested permissions may change later. - Gets the Channels authorization callback
tdiAuthBuffer
inextraJson
. It is returned in Base64 format and parsed in JSON. Use it after standard Base64 decoding. - Currently does not support timeout callback logic.
- MSDK only returns
tdiAuthBuffer
, check with WeChat point of contact [jaryqiu] and [gisonyang] for actual usage.
Supported Platform
- Unity
- Unreal Engine
Supports
Android, iOS
platform.Supports
Android, iOS
platform.Function Definition
- Unity
- Unreal Engine
void ChannelPermissionAuth(string channel, string permissions = "", string subChannel = "", string extraJson = "");
static void ChannelPermissionAuth(const std::string &channel, const std::string &permissions = "", const std::string &sub_channel = "", const std::string &extra_json = "{}");
Input Parameters
- Unity
- Unreal Engine
Parameter | Type | Description |
---|---|---|
channel | string | Channel name Case sensitive and currently only supports WeChat. |
permissions | string | The list of permissions granted by Channels Use comma (,) to separate multiple permissions, currently snsapi_channels_livestream is required. |
subChannel | string | Sub-channel name Case sensitive and currently not supported, pass null or ignore. |
extraJson | string | Extended field For more information, see relative channel descriptions. Currently not supported, pass null or ignore. |
Parameter | Type | Description |
---|---|---|
channel | string | Channel name Case sensitive and currently only supports WeChat. |
permissions | string | The list of permissions granted by Channels Use comma (,) to separate multiple permissions, currently snsapi_channels_livestream is required. |
subChannel | string | Sub-channel name Case sensitive and currently not supported, pass null or ignore. |
extraJson | string | Extended field For more information, see relative channel descriptions. Currently not supported, pass null or ignore. |
Callback Processing
The callback processing API is GUABaseResultObservers. The callback data structure is GUABaseResult.
- Unity
- Unreal Engine
The callback event is LoginBaseResultEvents
.
The callback methodID is GUA_ACCOUNT_CHANNEL_PERMISSION_AUTH
.
The callback event is OnBaseResultNotify
.
The callback methodID is kMethodIDAccountChannelPermissionAuth
.
Code Sample
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().ChannelPermissionAuth("WeChat");
GUA_NAMESPACE::GUAAccountService::ChannelPermissionAuth("WeChat");