Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS push notifications nightmares, Provisions app IDs and certificates

Hey Apple developers, I'm pulling my hair out trying to figure out how iOS provisioning profiles, certificates and app IDs work with push notifications. I thought I was close to getting this to work, but maybe not.

When I run my app and attempt to register push notifications, I get this error in the console:

2012-06-26 17:52:29.380 Grouped[1732:707] badgeNumber: 0
2012-06-26 17:52:30.089 Grouped[1732:707] [INFO] device is ready
2012-06-26 17:52:32.654 Grouped[1732:707] JSLOG: Registering with APNS via the App Delegate
2012-06-26 17:52:32.655 Grouped[1732:707] Register success callback set
2012-06-26 17:52:32.661 Grouped[1732:707] didFailToRegisterForRemoteNotificationsWithError:Error 
Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for 
application" UserInfo=0x18a0c0 {NSLocalizedDescription=no valid 'aps-environment' 
entitlement string found for application}

I've done several hours of research now and can't figure out what I'm doing wrong. I've created a new provisioning profile that is linked to my app ID. I can see it on my phone.

Any ideas?

Bonus question: Why on earth is it so complicated to properly provision an iOS app for push notifications?

like image 610
Ryan Martin Avatar asked Dec 11 '25 13:12

Ryan Martin


2 Answers

A couple things to check:

  • Do you have any other provisioning profiles for this app on your device? I'd delete them.
  • Does your App ID have push enabled in the provisioning portal?
  • Are you sure you're signing with the correct profile? It has to be a non-wildcard development certificate.
  • Are you specifying your own entitlements.plist file? Modern Xcode generates one, so you don't need to do this. Make sure your "Code Signing Entitlements" build setting is empty.

If you haven't already found it, Apple has a good FAQ about this:

http://developer.apple.com/library/ios/#technotes/tn2265/_index.html

like image 185
Jesse Rusak Avatar answered Dec 13 '25 04:12

Jesse Rusak


"no valid 'aps-environment' entitlement string found for 
application"

Your provision profile doesn't have push notifications enabled. Make sure you enabled them in the provisioning portal, generate a new profile, but more importantly make sure you actually installed it in Xcode and are signing your app with that profile. That last part has bitten me a couple times.

like image 36
OpenUserX03 Avatar answered Dec 13 '25 02:12

OpenUserX03



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!