Closed piemonte closed 5 years ago
Hi @piemonte
Thanks for reporting the issue, l'll try my best and help you to resolve it.
You've mentioned that you've noticed this issue in version 1.2.1
. Does it work in any other version?
Any additional information would be helpful so I can better understand your implementation and what could cause the issue.
Thanks!
@lukabratos thanks so much!
I tried rolling back and using 1.2.0
as well but encountered the same issue. Simply following the example project structure but you can see the details here:
https://gist.github.com/piemonte/c01b78adc6bece37a072b0e8c342b85e
I have left a comment in your gist that you've shared.
hey @lukabratos, thanks for the comments.
so we need to control when the user is prompted for this permission, which can't happen immediately after launch.
i'm assuming that start should only be called once registration has been confirmed to avoid the crash?
sorry, i should rephrase that:
so never call start unless you immediately call registerForRemoteNotifications after otherwise the library will crash later in the future or be in a bad state?
You need to call registerForRemoteNotification
eventually otherwise the SDK cannot get the device token that is needed for it to work.
Sometimes calling registerForRemoteNotifications
just after the start
method is not possible because you might have a certain UI workflow that at the end of it you would like to present the window asking user for permissions to enable remote notifications. Even it this case the SDK should not crash.
We handle a lot of things in the background in order to make the experience of the SDK as easy as we can. I'm not completely sure why this is happening in your case - it might be the way how you're controlling when the user is prompted for this permission.
We're improving some parts of the SDK at the moment so hopefully this issue will be resolved in the next release.
@lukabratos thanks, i appreciate the help. will hang in and try the next update.
Hi @piemonte
Can you please update the SDK to the version 2.0.0
and let me know if you're still experiencing the same issue.
Thanks
hey @lukabratos the crash appears to be fixed in 2.0.0
thanks so much for investigating and addressing the issue.
Hey Pusher,
I really value your folks products and am using your APNS service.
Recently, in release
1.2.1
, I started seeing a crash after registering a device token. It seems to be happening when the preIIS operation queue is resumed after being suspended. Not sure why this would be happening.Noticed an existing issue:
📎 https://github.com/pusher/push-notifications-swift/issues/71
Will that be applied to 1.2.1 other than the beta release?