Skip to main content

GUAQrCodeResultObservers [MSDK Only]

[MSDK Only] Register the callback of the QR module for the PC client, the game needs to process the callback function. For more information on the callback data structure, see the following GUAQrCodeRet.

note

It is strongly recommended to perform registration in the startup function of the game application.

Data Structures

GUAQrCodeRet

ParameterTypeDescription
ChannelIDintChannel ID of the logged channel
ChannelstringThe logged in channel
QrCodeUrlstringQR code URL

Function Definition

// QrCodeRetEvents callback, PC login QR code callback
event OnResultHandler<GUAQrCodeRet> QrCodeRetEvents;

Code Sample

#if GCLOUD_MSDK_WINDOWS
public void OnQrCodeRetEvent (GUAQrCodeRet qrCodeRet)
{
//Login QR code callback (For SDK authorization only, not required for Web)
Debug.Log ("OnQrCodeRetEvent in Login." + " channel:" + qrCodeRet.Channel + " qrCodeUrl:" + qrCodeRet.QrCodeUrl);
if (qrCodeRet.Channel == "QQ")
{
StartCoroutine (loadImage (qrCodeRet.QrCodeUrl));
}
else if (qrCodeRet.Channel == "WeChat")
{
if (qrEncodeController != null)
{
qrEncodeController.Encode(qrCodeRet.QrCodeUrl);
}
}
}
#endif