Search code examples
iosxcodepush-notificationremote-notifications

Fail to register for remote notifications


After updating Xcode version to 8.0 I'm getting this error. When trying to register for remote notifications I can see in my logs like this

 Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo={NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}, no valid 'aps-environment' entitlement string found for application

I tried after found some Stack Overflow answers related to my question but not able to solve this.

1.Created new Provisional Profile

2.Deleted and re-installed app

3.Tried to set provisional profile manually.

Any of the above not helped me to solve.

Please give me suggestions. Thanks in advance.


Solution

  • I recently had the same issue. After some non-obvious searching I found out that under iOS 10 and Xcode 8, you now need to enable the Push Notifications capability for your target.

    In Xcode, select your target. Go to the Capabilities tab. Enable the Push Notifications capability.