Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

How to control when an iOS user gets the permissions prompt #332

Closed TeamResilience closed 4 years ago

TeamResilience commented 4 years ago

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 4 years ago

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.

TeamResilience commented 4 years ago

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 4 years ago

@TeamResilience,

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

TeamResilience commented 4 years ago

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