flaviusilaghi
flaviusilaghi

Reputation: 661

Push Notification IOS

I have this error:

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

I can't figure this out. I did everything.I reinstalled the certificates a thousand times and this i still have this error.I have set aps-environment in the Entitlements.plist file.My Apple Development Push Certificate is in the keychain. The provisioning profiles has the push notification enabled. I have set the correct bundle. What can i do.I need solutions.Thanks.

Upvotes: 2

Views: 4439

Answers (4)

Dharmesh Siddhpura
Dharmesh Siddhpura

Reputation: 1650

Check below points before you build an application:

  1. Open your provisional profile which you are using to build the app in TextEdit.

  2. Make sure that provisional profile consists of key: "aps-environment". It can have 2 values i.e., "development" and "production" based upon the environment of the profile. If not then you have to make new provisional profile by adding APNS certificate to its AppId.

If the above things on place then try to build the app. Hope this helps.

Upvotes: 0

nithinreddy
nithinreddy

Reputation: 6197

Simple,

Delete the old provisioning profile and

Create a new provisioning file, after you enable push in the App ID.

This will work for sure.

Upvotes: 1

David Price
David Price

Reputation: 151

One thing I've not seen in the answers to many of the APNS questions is:

If your project has multiple targets, make sure you are selecting the target you are RUNNING and changing the Code Signing Identity in that target !

Upvotes: 1

g3rv4
g3rv4

Reputation: 19834

I saw this once... here's what I did to fix it:

  1. Click on your project (to access its settings)
  2. Go to "Build Settings"
  3. On "Code signing" select the exact profile you want to use

You should have a full AppId (not a wildcard one). If it's XXXXXX.*, you should create a new AppId so that it becomes XXXXXX.com.example.YourApp, generate a profile for it, and use it to sign your app.

Upvotes: 0

Related Questions