Video Channel Authorization [MSDK Only]
[MSDK Only] MSDK wraps the WeChat Channels authorization interface. By calling the ChannelPermissionAuth interface, currently WeChat requires passing snsapi_channels_livestream. In MSDK’s callback, obtain tdiAuthBuffer for subsequent live stream login. This feature does not impose restrictions on the login channel or login status, meaning the interface can be invoked across platforms.
note
- Currently only supports: "WeChat"
- Currently, please set the permission list to
snsapi_channels_livestream. This also serves as the marker for distinguishing normal login from permission requests at the lower level. WeChat may update the required permissions in the future - In the video account authorization callback,
tdiAuthBufferis present in theextraJsonfield, returned in Base64 format. Parse it via JSON and use standard Base64 decoding - Timeout callback logic is not supported yet
- MSDK only returns
tdiAuthBuffer. Contact WeChat points [jaryqiu] and [gisonyang] to check actual usage.
Supported platforms
- 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
| Parameters | Type | Description |
|---|---|---|
| channel | string | Channel name Case sensitive.Currently only supports: "WeChat" |
| permissions | string | Permission list granted by the channel Multiple permissions separated by commas (,), currently requires the snsapi_channels_livestream permission. |
| subChannel | string | Sub-channel name Case sensitive. Not supported yet; pass in null or exclude. |
| extraJson | string | Extended Fields For more information, refer to the corresponding channel documentation. Not supported yet; pass in null or exclude |
| Parameters | Type | Description |
|---|---|---|
| channel | string | Channel name Case sensitive. Currently only supports WeChat. |
| permissions | string | Permission list granted by the channel Multiple permissions separated by commas (,), currently requires the snsapi_channels_livestream permission. |
| subChannel | string | Sub-channel name Case sensitive. Not supported yet; pass in null or exclude. |
| extraJson | string | Extended Fields For more information, refer to the corresponding channel documentation. Not supported yet; pass in null or exclude |
Callback Handling
The callback handling interface is GUABaseResultObservers.The callback data structure is GUABaseResult.
- Unity
- Unreal Engine
The callback event is LoginBaseResultEvents. The callback ID is GUA_ACCOUNT_CHANNEL_PERMISSION_AUTH.
The callback event is OnBaseResultNotify. The callback ID is kMethodIDAccountChannelPermissionAuth.
Code Example
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().ChannelPermissionAuth("WeChat");
GUA_NAMESPACE::GUAAccountService::ChannelPermissionAuth("WeChat");