Xcode 8 beta ios 10 push notifications stopped working

After switching to xcode 8 beta, my push notifications stopped working.

My release code signing ID is installed in the distribution. I register the device, receiving a token and successfully downloading it to my server without any problems. But the push message status failed.

Just wondering if I need to make any changes or not work with the beta version of xcode.

+4
source share
3 answers

For the purposes, in the "Features" and "Push Notifications" sections, I needed to add push notification permission to my rights file. This was done simply by clicking the button that appeared here with the error message.

+12
source

For me, the question was when I first registered for a token. But when I cancel the registration token, and then try to re-register the token, the delegate token method is not called.

Now, if I turn the device off and on, it will work fine.

+5
source

In my project, push notifications worked correctly on iOS 9 and did not work on iOS 10. My project has a notification model that allows you to enable / disable push notifications from the initial settings and settings screen. And the state of this model was based on the UIUserNotificationSettings settings that can be obtained from the system (registerUserNotificationSettings: and currentUserNotificationSettings).

States: 1. UNDEFINED - currentUserNotificationSettings is nil or count count is 0 2. APLIED - currentUserNotificationSettings are equal to those requested by registerUserNotificationSettings: 3. DENIED - currentUserNotificationSettings are not equal ...

As I said, on iOS 9 this model works well, but on iOS 10 it never becomes UNDEFINED, because the number of countUserNotificationSettings categories is not zero, even if the application has been reinstalled.

Thus, the state of the model becomes DENIED when the application starts and does not call registerUserNotificationSettings: at all (it is assumed that the user refused push notifications).

+1
source

Source: https://habr.com/ru/post/1257544/


All Articles