When using a custom prompt for web push notifications, a two-step subscription process is the expected behavior. If the browser's native permission prompt does not appear after a user clicks "Accept" on your custom prompt, it usually points to an issue with your site's implementation.
The correct flow is as follows:
- Custom Prompt (Soft Ask): Your website first displays your custom-designed pop-up asking the user if they want to subscribe to notifications.
- Native Browser Prompt: When a user clicks the "Allow" or "Subscribe" button on your custom prompt, this action should immediately trigger the browser's own native permission prompt. The user must also grant permission on this second, native prompt to complete the subscription.
If the native prompt fails to appear, check the following:
- The "Accept" button calls
Pushwoosh.subscribe()directly from its click handler, for exampleonclick="Pushwoosh.subscribe()". Browsers only show the native prompt in response to a user action, so avoid calling it from a timer or after a long asynchronous delay. - The Web SDK is initialised with
autoSubscribe: false. If it istrue, the SDK requests permission on its own at initialisation instead of waiting for your button. - The Web SDK is fully initialised before your custom prompt is shown.
- The visitor has not already blocked notifications for your site. A browser shows its native prompt to a given user only a limited number of times; once the user has dismissed it repeatedly or chosen "Block", it will not appear again until the user changes the permission in the browser's site settings.
Learn more: How to create a custom subscription widget
Comments
0 comments
Please sign in to leave a comment.