0

I have created provisioning profile and app id and certificates & all of the process to enable push notification for one of my app, if I want to enable apns service for my second app shall I use same certificate or shall I create other provisioning profile and appid & certificates. I am using same certificates but I am getting following error.

Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x1cd26cb0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}

Even I am creating new certificate I am getting same error.where iam going wrong?i was struggling from few days help me

Juan Boero
  • 6,281
  • 1
  • 44
  • 62
siva
  • 251
  • 2
  • 16

2 Answers2

1

Siva, what matters for establishing an Apple Push Notification Service is:

  • App Id
  • Bundle Id of the app which is unique to each app.
  • Provisioning profile [development/distribution] depends on your enviornment.
  • Then the SSL certificates.

    So for your first question- you cannot use same certificates for two apps,which are having different bundle Id's. Because an SSL certificate is creating for a particular bundle Id. You can see that from your key chain.

    For the new app I would suggest you to create new Id, new bundle Id, new provisioning profile and offcourse new certificates. So there is no reason for any sought of confusions.

If the above mentioned error still prevails, you can refer these links- these are really worthy answers. How to fix "no valid 'aps-environment' entitlement string found for application" in Xcode 4.3?

Getting an error from push notification

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

Community
  • 1
  • 1
Augustine
  • 1,714
  • 1
  • 17
  • 21
  • actually i have created app id in app store without enabling push notifications shall i modify it or shall i proceed with new id, also after creating certificates which certificate i supposed to add to my project is it .cer or provisioning profile – siva Jun 21 '13 at 07:35
  • You should enable push notification for your app in the Apple developer portal. – Augustine Jun 21 '13 at 07:37
  • k thank you and after which certificate shall i need to add to my project – siva Jun 21 '13 at 07:39
  • If this is the first time you are implementing APNS, you should refer these tutorials:http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1 – Augustine Jun 21 '13 at 07:43
  • Or this:http://mobile.tutsplus.com/tutorials/iphone/iphone-sdk_apns/ This will give you a good idea of what is APNS and how to implement this.. From my personal experience, before using the actual server I implement APNS using Parse - https://www.parse.com/. They have an excellent tutorial and its very easy to use. – Augustine Jun 21 '13 at 07:44
  • i was enabled for push notification under particular app id now my doubt is shall i create new provisioning profile – siva Jun 21 '13 at 07:46
  • Yes, you should create new provisioning profile, when ever you make changes in the app. – Augustine Jun 21 '13 at 07:51
  • k thank you when the certificate expires what i supposed to do – siva Jun 21 '13 at 08:35
  • still now iam getting same error any modifications in my project – siva Jun 21 '13 at 09:08
  • If the certificate expires, you can create new one. Kindly check the links I have provided in the answer above. – Augustine Jun 21 '13 at 09:11
  • my certificate is not expired – siva Jun 21 '13 at 09:38
  • @siva please provide info on how did you resolved it, it is a hot topic and you could actually help others. – Juan Boero Dec 14 '15 at 19:36
0

Instead of certificate, Generate APNs key file.

enter image description here

https://developer.apple.com/account/resources/authkeys/add

Abdul Saleem
  • 10,098
  • 5
  • 45
  • 45