Skip to Content

Push notification setup

Connect OneSignal to Apple’s push service and Firebase Cloud Messaging, then add the OneSignal App ID to your app.

Prerequisites

Configure your platforms

Use one OneSignal app for both platforms. NativeExpress reads a single App ID.

Create an APNs key

In your Apple Developer account, create a key for Apple Push Notifications service (APNs). OneSignal requires a team-scoped key for Sandbox & Production. Follow its APNs key guide .

Generating a p8 key in the Apple Developer portal

Download the .p8 file and store it securely; Apple permits one download. Record the Key ID and your Team ID too.

The Key ID and Team ID shown in the Apple Developer portal's Keys section

Configure OneSignal for iOS

Create an app in the OneSignal dashboard , or open the app you already created for Android. Enable Apple iOS (APNs).

Creating a new app in the OneSignal dashboard

Select .p8 authentication and provide the file, Key ID, Team ID and bundle identifier. The bundle identifier must match config.jsgeneral.iosBundleIdentifier.

Verify

Confirm that OneSignal accepts the APNs credentials for your app, then add the App ID below and test delivery on an iOS device.

Connect the app

Add the OneSignal App ID

Copy the App ID from your OneSignal app’s Keys & IDs settings. Set it in .env.local:

.env.local
EXPO_PUBLIC_ONE_SIGNAL_APP_ID="<your-onesignal-app-id>"

For cloud builds, add the same variable to the EAS environment  used by your build profile.

Build and grant permission

Create a new development build with the updated configuration. On a fresh install, choose to enable notifications on the last onboarding screen and accept the system prompt. If onboarding is already complete, enable notifications in device settings or run your app’s permission action.

The OneSignal SDK and config plugin are already installed. The vendor’s Expo setup guide  provides additional platform troubleshooting.

Verify

Find the device’s subscribed push subscription in OneSignal, then send it a test notification. Check delivery with the app in the background on each platform you support.

Last updated on