Skip to content

Notifications (Cocos)

FRVRSDK.instance lets you ask the host channel to deliver a push / chatbot message to the player at a future time — the classic “come back tomorrow” retention prompt. Best support is on Facebook Instant; other channels may no‑op.

  1. Check canScheduleNotifications() — is the channel capable right now?
  2. Call subscribeNotifications() the first time the player opts in.
  3. Call scheduleNotification(config) to queue a specific message.
if (await FRVRSDK.instance.canScheduleNotifications()) {
  showReminderToggle();
}

Only expose your “remind me” UI when this is true — otherwise tapping does nothing.

await FRVRSDK.instance.subscribeNotifications();

Call the first time the player turns your reminder toggle on. Safe to call again later; it’s a no‑op once subscribed.

await FRVRSDK.instance.scheduleNotification({
  playerId:       await FRVRSDK.instance.getPlayerId(),
  delayInSeconds: 24 * 3600,                     // 1 day
  imageUrl:       'https://cdn.mygame.com/daily.png',
  message:        'Come back and play!',
  buttonTitle:    'Play Now',
});

When the player taps through, your game boots with entrypoint data reflecting the push — use entrypoint to route them into the right screen.

if (!await FRVRSDK.instance.canScheduleNotifications()) return;

await FRVRSDK.instance.subscribeNotifications();

await FRVRSDK.instance.scheduleNotification({
  playerId:       await FRVRSDK.instance.getPlayerId(),
  delayInSeconds: 86400,
  imageUrl:       'https://cdn.mygame.com/push.png',
  message:        'Your daily reward is ready!',
  buttonTitle:    'Play Now',
});