The default behavior
The first time a user opens your app, OneSignal initializes automatically and triggers the native push permission prompt. On iOS, a dialog appears asking “Allow notifications?”. On Android 13+, a system-level prompt appears.Platform scopeDelaying the push permission prompt applies to iOS and Android 13+ only. On Android 12 and below, push permission is granted automatically at install time, so there’s no prompt.
View diagram
Option 1: Delay the permission prompt
This is the most common customization. You disable the automatic prompt so you can trigger it at a more intentional moment such as after sign-up, after a user completes a key action, or when they navigate to a settings screen.Step 1: Disable automatic registration
In App Studio, go to Native Plugins > OneSignal and disable Auto-register for push notifications. This prevents OneSignal from showing the permission prompt on first launch. OneSignal still initializes in the background, and generates aoneSignalUserId, but the permission prompt doesn’t appear until it is triggered.
Step 2: Trigger the prompt from JavaScript
When you’re ready to prompt the user, call:Important distinction:Delaying registration is not the same as preventing OneSignal from initializing. Even with auto-register disabled, OneSignal still runs in the background and generates a
oneSignalUserId. If you need to prevent all data transmission to OneSignal until the user explicitly consents, for GDPR compliance, for example, use Option 2 instead.Option 2: Require privacy consent before initializing OneSignal
By default, your app transmits device data to OneSignal as soon as it launches. For apps subject to GDPR or other privacy regulations, you may need to prevent that until the user has explicitly agreed to your privacy policy. This is a stricter setting than delayed registration. With privacy consent required, OneSignal doesn’t initialize at all. It doesn’t generate aoneSignalUserId or send any data until you call the grant method below.
Step 1: Enable the privacy consent requirement
In App Studio, go to Native Plugins > OneSignal and enable Require user privacy consent before transmitting data.Step 2: Grant consent from JavaScript
Once your user has accepted your privacy policy or consent flow, call:Important noteRevoking consent stops data transmission to OneSignal, but it does not prevent push notifications from being delivered to a device that’s already opted in. To stop a user from receiving notifications, use data tags to manage their notification preferences, or call
median.onesignal.logout() to disassociate them from their OneSignal user record. See Identifying and targeting users for details.Option 3: Soft prompt (in-app message before the native dialog)
On both iOS and Android 13+, the system shows a native dialog when you request push permission. A soft prompt is an in-app message you control, shown before that dialog, that explains why notifications are useful and lets the user decide whether to proceed. If they choose “Maybe later,” you skip the system prompt and can try again when context is better. Why use it on every platform: OneSignal recommends priming users before the native ask. That improves opt-in whether the user is on iPhone or Android. Platform difference (iOS): On iOS, if the user already tapped “Don’t Allow” on the system dialog, Apple doesn’t let your app show that dialog again. They must change the setting in Settings. The soft prompt matters because it avoids burning that one chance before the user understands the value. Platform difference (Android): Android 13+ does not use Apple’s single-shot rule for the notification permission prompt; recovery paths differ by OS version and manufacturer. A soft prompt is still useful to explain value before the system dialog appears — especially on Android 13+, where permission is not granted at install time.How it works
- Your app shows a custom in-app message (the soft prompt), designed and controlled by you
- If the user taps “Allow,” your app then triggers
median.onesignal.register()to show the native permission prompt - If the user taps “Not now,” you skip the native prompt entirely and can surface the soft prompt again later
When to show it
The soft prompt works best at moments of high intent, such as when a user has just done something that makes notification value obvious:- After sign-up or account creation — “Get notified when your order ships”
- After a purchase or booking — “We’ll send you updates on your order”
- After a user completes onboarding — when they’ve invested enough to care about updates
- On a dedicated notification settings screen — where the context is already clear
Building the soft prompt
The soft prompt is an in-app message configured in OneSignal’s dashboard using their HTML Composer, or via API. You control the design, copy, and button actions entirely.
Example in-app message in the OneSignal dashboard
- “Allow” button — triggers
median.onesignal.register()to show the native permission prompt - “Maybe later” button — closes the in-app message without triggering the native prompt
Android note:Android doesn’t have the “one prompt only” restriction that iOS does, so a soft prompt is less critical there. It can still improve opt-in rates if you want to explain the value of notifications before the system prompt appears on Android 13+.