Skip to main content

Register or Unregister Push (RegisterPush/UnregisterPush)

[Player Network SDK & MSDK] Register Firebase channel push notifications to receive messages from the Firebase channel. Bind an account to a registered device so that the game can push notifications to the specified account in the background.

Supported platforms

Supports Android, iOS platform.

Function Definition

// Register push notification
void RegisterPush(string channel, string account = "");

// Unregister push notification
void UnregisterPush(string channel);

Input Parameters

ParametersTypeDescription
channelstringChannel Definition
"Firebase"
accountstringBound account
Once bound, push messages can be sent to the account; account cannot be single characters like “2”, “a”

Callback Handling

The callback handler interface is GUAPushBaseResultObserver.The callback data structure is GUABaseResult.

The callback event is PushBaseResultEvents. The callback IDs are GUA_PUSH_REGISTER and GUA_PUSH_UNREGISTER.

Code Example

// Register push notification
UnionAdapterAPI.GetPushService().RegisterPush("Firebase");

// Unregister push notification
UnionAdapterAPI.GetPushService().UnregisterPush("Firebase");