Sergio Sergio -4 years ago 95
iOS Question

Apple Push Notifications not received in iOS 9/10 after switching it on Capabilities

I've tried to adapt my application to iOS 10, but I am facing issues with push notification. I have tested push in two devices with iOS 9 and iOS 10. In my application in Capabilities push notification does not switch on, but application work fine in iOS 8 and iOS 9, but in iOS 10 i can't take token with error:

Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application"

I switched on Push Notification in Capabilities, and push Notifications works, sometimes it works fine in iOS 10, but next morning, I tested it on iOS 9 device and it did not work, I switched to iOS 10 device and push is not working on it as well, I went back to old version, without turning on Capabilities and it works fine in iOS 9 device, but in iOS 10 does not (token).
I tried removing and download provisional profiles, remove all cache in Xcode, erase devices, I tried Push notification issue with iOS 10
but it did not worked.

How can i fix it ??

Answer Source

I found solution, in my case: Before iOS 10 we used only Production sertificate to test push, it work fine, but after iOS 10 pushes do not receive in app runing with Xсode(but receive in TestFlight), after we create and use developer certificate to sign pushes - it work again

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download