Yes. You can show a "pre-permission" or soft-prompt in-app message explaining the value of push notifications before the iOS system prompt appears. The key is to trigger the native permission prompt from a button inside your in-app message rather than calling the registration method at app launch.
Step-by-step guide
- Create the in-app template. In the Control Panel go to Content → In-apps (Rich media) and create a template with the built-in editor, pick one from the built-in library, or upload your own ZIP.
-
Wire the button to the permission prompt. In the built-in editor, select the button (for example "Allow Notifications"), set Action type to Custom Javascript, and put this in the onClick field:
If you maintain the template as raw HTML instead, the same call goes in the button's onClick attribute:window.pushwoosh.registerForPushNotifications()
Replace any existing action such as<button onclick="window.pushwoosh.registerForPushNotifications()">Enable Notifications</button>window.pushwoosh.openAppSettings(). UseopenAppSettings()only for users who have already denied permission, since iOS shows the system prompt only once. - Save the template.
- Create the campaign. Go to Campaigns → Instant in-apps and click Create in-app.
-
Configure it: select your template, choose the audience, and pick the trigger event — for example the default
PW_ApplicationOpenorPW_DeviceRegisteredevent, or a custom event fired after the user completes a meaningful action. - Save and launch. When the event fires the user sees your in-app first; tapping the button then shows the native iOS permission prompt.
Note: neither registerForPushNotifications() nor openAppSettings() closes the in-app message — they only forward the call to the SDK. Add window.pushwoosh.closeInApp() in the same onClick if you want the message to disappear after the tap.
Using this in a Customer Journey
The same in-app works inside a Customer Journey, but the timing differs:
- Instant in-apps are triggered immediately by an in-app event, so they display right away.
- Customer Journeys show the in-app immediately only if the app is open when the In-app element is reached; otherwise it is shown the next time the user opens the app.
For an opt-in flow specifically, the recommended pattern is a trigger-based Journey entered on PW_DeviceRegistered, or an Instant in-app as described above.
Comments
0 comments
Please sign in to leave a comment.