So I have this app called Dripper that I put out about a month ago and then an update a couple days ago. The update added push notifications and a few little tweaks. I tested it with the sandbox-apn using the development profile and things worked great. Then I switched things to the production-apn and pushed it to test-flight, again things worked perfectly. Once I put update on the market and ran it I noticed I wasn’t getting any new push registrations on the server. I looked at the console logs for the device and found this:
Dec 4 17:55:15 Ina-touch-it coffco[1210] : Registering for remote notifications
Dec 4 17:55:15 Ina-touch-it SpringBoard[52] : No valid 'aps-environment' entitlement string found for application 'Dripper': (null). Notifications will not be delivered.
Dec 4 17:55:15 Ina-touch-it coffco[1210]<Warning>: Failed to register with error : Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x174270900 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
I am a bit confused because I thought that the production-apn would function the same between ad-hoc and app store builds.
Here is my app id and its entitlements:
Here is the provisioning profile for the apps store:
In XCode 8 I saw an error in this section saying an entitlements file needed to be added. I clicked on this to correct it and then it worked ok.
Only recently popped up when starting to develop in Xcode 8 and this fixed it. Thanks!
Was previously working on Xcode 7.3 but suddenly not registering on Xcode 8, but this solved my issue by enabling push notification capability.
Apple decides to hide this option somewhere deep inside Xcode 8.1. Please let me know if anyone is able to find it.
I didn't get the "Push notification" option in the capabilities list. It was something to do with the fact that XCode was automatically generating my provisioning profile (I'm new to iOS dev so I might be wrong...). I had to sign into my developer account and manually create a provisioning profile for my app before it displayed Push Notifications in the capabilities list. Finally, enabling it fixed this issue.