Skip to main content

GUAPushBaseResultObserver

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

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]
PushBaseResultEventsRegisterPush,
UnregisterPush,
SetTag,
DeleteTag
-AddLocalNotificationAtFront
event OnResultHandler<GUABaseResult> PushBaseResultEvents;

Code Sample

// Add callbacks
UnionAdapterAPI.GetPushService().PushBaseResultEvents += OnPushBaseResultEvent;
// Remove callbacks
UnionAdapterAPI.GetPushService().PushBaseResultEvents -= OnPushBaseResultEvent;

// PushBaseResultEvents callback
private void OnPushBaseResultEvent(GUABaseResult ret)
{
string methodTag = "";
if (ret.MethodId == (int)GUAMethodID.GUA_PUSH_REGISTER)
{
methodTag = "RegisterPush";
}
else if (ret.MethodId == (int)GUAMethodID.GUA_PUSH_UNREGISTER)
{
methodTag = "UnregisterPush";
}
else if (ret.MethodId == (int)GUAMethodID.GUA_PUSH_SET_TAG)
{
methodTag = "SetTag";
}
else if (ret.MethodId == (int)GUAMethodID.GUA_PUSH_DELETE_TAG)
{
methodTag = "DeleteTag";
}
Debug.Log(methodTag + ret.ToString());
}