Skip to main content

GUAQrCodeResultObservers [MSD only]

[MSDK Only] Callback for the PC registration QR code. The game must handle this callback accordingly.For more about the callback data structure, see GUAQrCodeRet.

note

It is strongly recommended that the game performs the registration in the application startup function.

Data structure

GUAQrCodeRet

ParametersTypeDescription
ChannelIDintLogin channel ID
ChannelstringLogin channel
QrCodeUrlstringQR code address

Function Definition

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

Code Example

#if GCLOUD_MSDK_WINDOWS
public void OnQrCodeRetEvent (GUAQrCodeRet qrCodeRet)
{
//Login QR code callback (required only for SDK authorization; not required for Web authorization)
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