I’m currently working on getting Push Notifications to work in my test application using Urban Airship’s service and got this message:
Failed to register with error: Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0x117520 "no valid 'aps-environment' entitlement string found for application"
I searched the web and most of the blogs/tutorials I found mentioned that I needed to create a provisioning profile in my iPhone developer account which is configured for push notifications.
I was pretty confident that my account was setup properly because I was already able to send push notifications before using an app id that I created so I assumed the problem was with my development setup.
Below are the steps I followed to make push notifications working again:
1. Check whether the profile you’re using for the application is the one configured with push
Often times developers will have multiple provisioning profiles to test and develop on devices. In my case, I had a generic/wildcard profile (BLAHBLAHXX.*) for deploying on the device and another profile for an actual app configured for Push notifications (BLAHBLAHXX.com.companyname.appname).
I was using the generic profile when I checked so I had to switch that back to the profile configured for push. To edit your setting choose Project > Edit Project Settings > Code Signing and then choose the appropriate profile.
2. In case step 1 did not fix your problem (like in my situation), delete all the apps in your device which use the provisioning profile for push notification and perform a soft reset.
3. In Xcode, try to clean all targets. Reboot your machine (probably not necessary but it does wonders most of the time). Then re-build and deploy.
I was back in business with APNS after following those three steps.
HTH.