Skip to main content
Theymes SDK supports three kinds of notifications:
  • In-game notification badges
  • In-game text notifications
  • Background text notifications (push)
By default the SDK periodically polls for notification events for players who have engaged with support. When there’s a new notification, you can show a text notification in-app or display a badge in your UI. Control whether text notifications are shown while the app is in the foreground by calling Theymes.enableNotifications() and Theymes.disableNotifications(). In-game text notifications are disabled by default. Typically you enable them when the player is in menus and disable them during gameplay.

In-game notification badges

You can show a badge for:
  • Unread messages – badge when the player has messages they haven’t read.
  • Unanswered messages – badge when the ticket is waiting for the player to reply (even if they read the message).
To set up badges:
  1. Implement the TheymesDelegate and set Theymes.delegate. Use didUpdateUnreadMessageCount(_:) and/or didUpdateUnansweredMessageCount(_:) to react to count changes.
  2. Get the initial count with Theymes.getUnreadMessageCount() or Theymes.getUnansweredMessageCount(). We recommend setting the delegate first so you don’t miss updates.
  3. Use the count to display a badge in your UI.

In-game text notifications

Theymes uses native iOS notifications to show in-game text notifications. You need to:
  1. Request notification permission from the user.
  2. Enable notifications with Theymes.enableNotifications().
You can request permission using the system APIs (e.g. UNUserNotificationCenter) or use Theymes’ convenience API: Theymes.requestNotificationPermission().
To get an APNs device token for push notifications, use the system APIs (e.g. registerForRemoteNotifications and application(_:didRegisterForRemoteNotificationsWithDeviceToken:) in your AppDelegate). Then pass the token to Theymes with Theymes.registerPushToken(_:type:) using PushTokenType.apns.

Background notifications

To show notifications when the app is in the background, set up push notifications. Theymes supports both FCM and APNs on iOS. Notifications are delivered in real time; when the app is in the foreground, Theymes respects whether in-game notifications are enabled. Badge counts are updated immediately when a push is received. See Push notifications for setup.