Skip to main content

NoticeResultObserver

[MSDK & Player Network SDK] Register the callback of the notice module, the game needs to process the callback function. For more information on the callback data structure, see GUANoticeResult.

note

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

Function Definition

The list of methods used to process the callback events.

Callback EventCommon[Player Network SDK Only][MSDK Only]
NoticeResultEventsLoadNoticeData--
event OnResultHandler<GUANoticeRet> NoticeResultEvents;

Code Sample

// Add callbacks
UnionAdapterAPI.GetNoticeService().NoticeResultEvents += OnNoticeResultEvent;

// Remove callbacks
UnionAdapterAPI.GetNoticeService().NoticeResultEvents -= OnNoticeResultEvent;

// NoticeResultEvents callback
private void OnNoticeResultEvent(GUANoticeRet noticeRet)
{
Debug.Log("OnNoticeResultEvent");
string methodTag = "";
if (noticeRet.MethodId == (int)GUAMethodID.GUA_NOTICE_REQUEST_DATA)
{
methodTag = "RequestNoticeData";
}

Debug.Log(methodTag + noticeRet.ToString());
NoticeSample noticeWindow = m_sample as NoticeSample;
if (noticeWindow != null)
{
noticeWindow.SetNoticeResult(noticeRet);
}
}