Notifications
Schedule notifications that the host platform shows after the player leaves the game. Use them to bring players back: a daily energy refill, an expiring bonus, "your building is ready".
Notifications are delivered by the host platform, not by the game. Support is platform-specific — currently only MSN shows them. Everywhere else isSupported is false and the methods reject, so always gate your UI on isSupported.
Implementation order
Required — Map every notification id to its platform value in the config under
notifications.Recommended — Check
isSupportedbefore showing any notification-related UI.Recommended —
schedule()a re-engagement notification at a natural moment (level completed, energy spent, session about to end).Recommended — On launch, read
platform.payloadto find out whether the game was opened from a notification, and route the player accordingly.
Configuration
The game always works with its own notification id. Platforms that need their own identifier get it from the notifications section of the config:
{
"notifications": [
{
"id": "come_back", // the id you pass to schedule() / cancel()
"msn": 1 // MSN notification type — an integer from 0 to 15
},
{
"id": "energy_full",
"msn": 2
}
]
}On MSN a notification without an integer type in the config is rejected — the platform identifies notifications by type, not by name.
Automatic re-engagement notifications
On MSN, Bridge schedules three re-engagement notifications right after initialization — shown no earlier than 1 day, 3 days, and 7 days after the session. They require no code and occupy MSN types 8, 9, and 10, which is why those types are rejected for your own notifications.
To replace them with your own, turn them off in the config:
Is Supported
Check support before showing notification-related UI (an opt-in toggle, a "remind me" button).
Use the Is Notifications Supported condition.
Use the Is Notifications Supported condition.
Schedule
Schedules a notification. The platform shows it after the player has left the game, no earlier than delaySeconds from now.
Build the notification with the common Add Action Parameter actions (id, title, description, delaySeconds, image, callToAction, payload), then run Notifications Schedule and handle the On Notifications Schedule Completed trigger.
Build the notification with the common Add Action Parameter actions (id, title, description, delaySeconds, image, callToAction, payload), then run Notifications Schedule and handle the On Notifications Schedule Completed condition.
Notification fields
id
string
yes
Game-level id, mapped to the platform value in the config.
title
string
yes
Notification headline. MSN: up to 60 characters.
description
string
yes
Notification body. MSN: up to 200 characters.
delaySeconds
integer
no
Minimum delay before the notification may be shown. MSN: up to 604800 (7 days).
image
string
no
Image for the notification. MSN expects base64 image data.
callToAction
string
no
Label of the notification button.
payload
string
no
Arbitrary string returned through platform.payload when the game is launched from this notification.
Cancel
Cancels a previously scheduled notification by its game-level id.
No platform supports cancellation yet — the call rejects on every platform, MSN included. Schedule notifications you are sure about, and use payload to detect and skip an outdated one at launch.
Call the Notifications Cancel action with the notification id, then handle the On Notifications Cancel Completed trigger.
Call the Notifications Cancel action with the notification id, then handle the On Notifications Cancel Completed condition.
Cancel All
Cancels every notification scheduled by the game. Same platform limitation as Cancel.
Call the Notifications Cancel All action, then handle the On Notifications Cancel All Completed trigger.
Call the Notifications Cancel All action, then handle the On Notifications Cancel All Completed condition.
Handling the launch payload
When the player opens the game from a notification, the notification's payload arrives as the regular platform payload. There is no separate notifications API for it — read platform.payload after initialization.
On System → On start of layout, compare the PlaygamaBridge.PlatformPayload expression with the payload you scheduled.
Once Is Initialized is true, compare the PlaygamaBridge::PlatformPayload() expression with the payload you scheduled.
Last updated