Skip to main content
Playtolia Push uses Firebase Cloud Messaging (FCM) to send notifications across Android and iOS — transaction confirmations, social updates (friend requests, party invites), and marketing messages.

Requirements

Enable Playtolia Push

Navigate to Edit → Project Settings → Playtolia Settings and enable Push Notifications. Changes take effect with the next build.

Notification permission

Android 13+ and iOS require explicit permission. Choose a strategy in Playtolia Settings:
StrategyWhen permission is requested
During InitializationOn first app launch
After LoginImmediately after the player logs in
CustomYou call the request manually
It’s generally better UX to ask for notification permission after the player has experienced some value — after a tutorial or first session, not immediately on launch.

Requesting permission manually (Custom strategy)

PlaytoliaNotifications.RequestPushPermission();

Checking permission status

string permission = PlaytoliaNotifications.GetPermission();
// Returns: "Granted", "DeniedAlways", or "NotGranted"

Registering a push token

After Firebase initializes and provides a token, pass it to Playtolia so the backend can target this device:
PlaytoliaNotifications.RegisterPushToken(firebaseToken);

Opening notification settings

Sends the user to the OS notification settings for your app — useful when permission was previously denied:
PlaytoliaNotifications.OpenNotificationSettings();

Reading state

var state = PlaytoliaNotifications.GetState();
// state.Permission  — current permission string
// state.Preferences — Dictionary<string, bool> of notification categories

Listening to changes

void Start()    => PlaytoliaNotifications.AddListener(OnNotificationsChanged);
void OnDestroy() => PlaytoliaNotifications.RemoveListener(OnNotificationsChanged);

void OnNotificationsChanged()
{
    var state = PlaytoliaNotifications.GetState();
    // update UI
}