Skip to main content

RegisterPush/UnregisterPush

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

Supported Platform

Supports Android, iOS platform.

Function Definition

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

// Unregister push
void UnregisterPush(string channel);

Input Parameters

ParameterTypeDescription
channelstringThe channel to push notifications.
"Firebase"
accountstringThe linked account.
Linking enables notifications to be pushed to the specified account. The account value cannot be single characters such as “2” and “a”.

Callback Processing

The callback processing API is GUAPushBaseResultObserver. The callback data structure is GUABaseResult.

The callback event is PushBaseResultEvents. The callback methodID is GUA_PUSH_REGISTERGUA_PUSH_UNREGISTER.

Code Sample

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

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