I am encountering this error when I am loading an Ad Hoc build of my Push Notification enabled iPhone app onto my device:
no valid aps-environment entitlement found for application
What does it mean, and how do I repair it?
APS Environment (macOS) Entitlement. The environment for push notifications in macOS apps. Key: com.apple.developer.aps-environment. com.apple.developer.usernotifications.filtering. Enable receiving notifications without displaying the notification to the user.
Missing Push Notification Entitlement - Your app includes an API for Apple's Push Notification service, but the aps-environment entitlement is missing from the app's signature. To resolve this, make sure your App ID is enabled for push notification in the Provisioning Portal.
I found the solution. In my project info under Build > Code Signing Identity I had it set to automatic, and it was selecting an AdHoc distribution profile which did not have push notifications enabled. (It was the wrong one.) I have selected the correct profile and the error is gone.
Push Notifications must be enabled for your App ID before creating a Provision Profile.
So, in this order:
Create your APP ID
Enable APNS
Create the Provisioning Profile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With