Pushwoosh/pushwoosh-phonegap-plugin

How to control when an iOS user gets the permissions prompt

Closed this issue · 4 comments

Currently the prompt that asks the user to allow push notifications appears as soon as the app starts. I can't seem to be able to figure out how to control this.

I'm talking about the native prompt like:
"YOUR APP" Would like to Send You Notifications
Notifications may include alerts, sounds and icon badges. These can be configured in Settings.
Don't Allow | Allow

wfhm commented

Hi @TeamResilience,

This prompt is shown when you actually call the pushwoosh.registerDevice() method is called. If you want to show the prompt to your user somewhere else in your app, you should just move the call of registration method in a different place in your code.

Thank @wfhm, I think this is something that can and should be clearly stated in the documentation. I think this is the logical place to do it. I'll have to figure out why this code is apparently called when our app starts.

wfhm commented

@TeamResilience,

Thanks for the tip. This will be added to public documentation shortly.

The weird behavior is caused by our development built. In the production build the prompt is shown as expected.