Skip to main content

iOS Push Notifications

Additional iOS setup for rich notifications and background tracking.

Notification Service Extension

The Notification Service Extension has two purposes:

  1. Rich notifications — Starting with iOS 12.0, Apple enabled applications to receive and display notifications that contain media content such as images. Notifications must be processed by the Notification Service Extension before being shown to the user.
  2. Background tracking — In order for Ometria to accurately track all notifications received when the app is in quit state, it needs a background service that has access to all notifications.

If you're using Expo with the Ometria config plugin, the Notification Service Extension is created automatically during npx expo prebuild. No manual Xcode configuration is needed.

The plugin automatically:

  • Creates the OmetriaNotificationServiceExtension target in Xcode
  • Generates appGroupIdentifier as group.{ios.bundleIdentifier}
  • Sets up all entitlements (push notifications + app groups) for both targets
  • Configures Info.plist so the native SDK reads the app group value automatically
  • Adds the required Podfile configuration (use_frameworks!, NSE pod target)

Plugin Options

Add to your app.json or app.config.js:

{
"expo": {
"plugins": [
["react-native-ometria"]
]
}
}

If you need a custom app group identifier:

{
"expo": {
"plugins": [
["react-native-ometria", { "customAppGroupIdentifier": "group.com.custom.identifier" }]
]
}
}

To skip the NSE setup entirely (rich notifications and quit-state tracking will not work):

{
"expo": {
"plugins": [
["react-native-ometria", { "skipNSE": true }]
]
}
}

After configuring, run:

npx expo prebuild

Background/Quit State Handling

With the Notification Service Extension configured, notifications received when the app is in quit state will automatically:

  1. Be tracked as notificationReceived events
  2. Display rich content (images)

No additional React Native code is needed for iOS background handling — the NSE handles everything natively.

Sample App

For a complete example, see the Expo sample app.