Skip to main content

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 in extraJson. 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

Supports Android, iOS platform.

Function Definition

void ChannelPermissionAuth(string channel,  string permissions = "",  string subChannel = "", string extraJson = "");

Input Parameters

ParameterTypeDescription
channelstringChannel name
Case sensitive and currently only supports WeChat.
permissionsstringThe list of permissions granted by Channels
Use comma (,) to separate multiple permissions, currently snsapi_channels_livestream is required.
subChannelstringSub-channel name
Case sensitive and currently not supported, pass null or ignore.
extraJsonstringExtended 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.

The callback event is LoginBaseResultEvents. The callback methodID is GUA_ACCOUNT_CHANNEL_PERMISSION_AUTH.

Code Sample

UnionAdapterAPI.GetAccountService().ChannelPermissionAuth("WeChat");