-
Notifications
You must be signed in to change notification settings - Fork 1.9k
iOS asks for autorisation before init() is called #49
Comments
@martinfilliau You are not wrong. In fact I remember reading this article and referencing it as best practices during one of my presentations. I will look into fixing it for the 1.2.0 release. |
I was also wondering, because I was heavily investing of delaying the init calls, just to find out that the permissions are directly asked for. So big +1 for this. |
@martinfilliau can you give me a bare bones .js file that reproduces the problem because I can't. If I put the code that calls PushNotification.init() in an onClick handler of a button then I don't get the pop up dialog until I actually click the button. So it is working as I'd expect it. You can see my gist here: https://gist.github.com/macdonst/6675af8186c9a6468f25 |
@macdonst sorry for long delay in answer. I have just used your gist and the plugin version We use Phonegap Build and the only plugins installed are:
I had resetted my push notification settings using the procedure as described in https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42 I have an iPhone 5S running iOS 8.4.1. |
+1 I can't migrate from PushPlugin until this is resolved |
@ptarjan Can you reproduce the issue as well? I have not been able to so I can't fix it until I can. I'm surprised that it works differently than the old PushPlugin because same code base. |
@macdonst I didn't repo it, I just saw the issue and decided not to migrate. I'll try to migrate again when I get some time. |
@ptarjan have you been able to test this plugin regarding this issue? |
@martinfilliau thanks for cycling back to me. Yes, I have migrated and the dialog appears in the right place. Mark as resolved please. |
This thread has been automatically locked. |
Immediately after our application starts, the iOS window "X would like to send you push notifications", yet before the
init
method of the push plugin is called.We would like to defer the initial demand to be aligned with the call to
init
so that users are not immediately asked if they want to receive push notifications (research shows that people are less inclined to accept if they don't know what it is for, e.g. http://techcrunch.com/2014/04/04/the-right-way-to-ask-users-for-ios-permissions/)Not sure to exactly understand how everything is happening in
AppDelegate
, any idea on this?The text was updated successfully, but these errors were encountered: