How to ask for push permission with a pre-permission in-app
यह सामग्री अभी तक आपकी भाषा में उपलब्ध नहीं है।
A pre-permission in-app is your own message that comes before the system push permission prompt. It explains why notifications are useful, and the system prompt appears only after the user says yes in it. This guide shows the in-app on iOS and Android when an event happens, for example right after onboarding, and builds a segment of users who still have push disabled.
Prerequisites
Anchor link to- The Pushwoosh SDK integrated in your iOS or Android app. See Pushwoosh SDK overview.
- A pre-permission in-app template with an accept and a decline button. See Create a pre-permission in-app.
- A custom event your app sends at the moment you ask. Your developers set it up as described below.
Choose when to ask
Anchor link toPick the moment before you build the journey, because your developers send the event at that moment.
Use these guidelines:
| Do | Don’t |
|---|---|
| Ask right after onboarding | Ask on first launch or during the tutorial |
| Ask when the user taps a feature that needs notifications | Let the app request permission in code before the in-app |
| Explain in the in-app why notifications are useful | Show the system prompt before the explanation |
- Choose the moment from the table. This guide asks right after onboarding.
- Agree with your developers on a custom event name for that moment, for example
onboarding_completed. For a feature that needs notifications, an event such aslocked_feature_tappedworks the same way.
Build the journey
Anchor link toA device that hasn’t registered for push yet has no push token, so a push notification can’t reach it. The journey shows an in-app instead, started by the event.
- Go to Customer Journey Builder → Create Campaign.
- Add a Trigger-based entry and select
onboarding_completedas the event. - Add an In-app element and select your pre-permission template. See Send in-apps via Customer Journey.
- Launch the journey.
The in-app doesn’t appear the instant the event fires. The device has no push token yet, so the in-app waits for the next time the user opens the app.
Every user who completes onboarding sees the in-app once. The display condition from Skip the prompt for users who already opted in hides it from users who already allowed push. If your event can fire again for the same user, such as locked_feature_tapped, set a campaign entry limit so the in-app doesn’t repeat.
Build a segment of users who still have push disabled
Anchor link toThe Push Alerts Enabled tag is false when the device can’t show push alerts. On iOS and on Android 13 and later, this includes devices whose users haven’t seen the system dialog yet, so the segment holds both users who declined and users who were never asked. On Android 12 and earlier, notifications are allowed without a dialog, so these devices are in the segment only if the user turned notifications off. To separate users who were never asked from users who declined, use the Push Permission Status tag instead.
- In the segment builder, add a filter by the Push Alerts Enabled tag.
- Set the operator to is false. See Boolean tag operators.
Use this segment to hold back a repeat prompt from users who still don’t have push enabled, or to run a periodic win-back journey.
Check the results
Anchor link toTo test both buttons, use two test devices (or two fresh installs) on iOS or on Android 13 and later that haven’t granted or denied push yet, one for each button. Android 12 and earlier don’t show a permission dialog. The system prompt appears only once per install, so one device can’t test both.
- On both devices, fire
onboarding_completedfrom the app. - On both devices, reopen the app and confirm the journey delivers your in-app.
- On the first device, tap the accept button and confirm the system permission dialog appears.
- On the first device, tap Allow in the system dialog.
- On the second device, tap the decline button and confirm the in-app closes with no system dialog.
- Reopen the app on both devices.
- In User Explorer, open each device from the Test devices tab, go to the Devices and platforms tab, and check Push Alerts Enabled in the device’s tags:
trueon the first device,falseon the second.
Next steps
Anchor link to- Create opt-out recovery popups: win back users from the segment above with the same Push Alerts Enabled tag.
- Push Permission Status: target users who were never asked separately from users who declined.