Receive error from push notification

In my application, I need push notifications. I follow all the instructions from the push push notification docs. But I received a message from Push Notification:

Fail To Register For Remote Notifications With Error: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x2340a0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application} 

What am I doing wrong?

+46
objective-c iphone apple-push-notifications
Mar 28 2018-11-11T00:
source share
15 answers

Create a new training profile after enabling Push, and it will work!

+44
Jul 10 '12 at 19:25
source share
— -

I am using Xcode 6.1.1

You do not need to delete or recreate anything. You just need to make Xcode renew active certificates (including the new push push certificate).

Just go to Xcode> Settings> Accounts> select your account> select command> View Details

Click the Refresh button in the lower left corner. (Also check your code signature in the build settings)

enter image description here

+25
Dec 11 '14 at 19:48
source share

I had the same problem.

I decided to make sure that in the Built-in settings , Identification of code signing for debugging, set the correct Provisioning Profile

where you activated push notifications.

+19
Feb 27 '13 at 17:53
source share

First, you need to make sure that you are using the application identifier without a template. Then you need to enable this push notification application for development.

Check out this tutorial , for example.

Even after you have included your push application identifier, it may take several hours to work.

+18
Mar 28 '11 at 11:03
source share

It made me go crazy. I cross-checked everything, but still got the same error. Tried all the other solution given on the Internet. However, this did the trick for me. I am creating a .mobileprovision file before enabling APNS. It was a real mistake. The solution to this problem is:

  • Create Application ID
  • Enable APNS
  • Then create a Provision file

If you have previously created a service provisioning profile and you have enabled APNS, you must delete the provisioning file everywhere in your system (Xcode, keychain, iTuneConnect). Then create the initialization file again.

+8
Nov 08
source share

I just looked at this issue. Although there is probably a lot going on, that’s what I found out.

When you make changes to the application ID, such as enabling push notifications, you need to create a new provisioning profile. I must have created my application ID, profiled it, and then included notifications in the application ID.

As soon as I deleted the provisioning profile from the portal and the device, I made a new one using the changed application identifier. After downloading it, threw it on your device, please thank you, ma'am, it worked. Hope this helps people in the future!

+2
Jan 05 '12 at 19:10
source share

It just solved it for me, so I will share it. If you update your application ID, you must remove the profile from your device, xcode, and developer.apple.com. Then create a new appropriate provisioning profile that will be updated using the new application identifier settings. It’s best to call it something else, so you know you’re choosing the right one.

+2
Oct. 23
source share

The first thing you need to run applcaiton in the device.

This will happen in xcode 3.2.6. Because when you get everything perfect. But your application does not register on your iphone, ipad or ipod. You need to generate the Entitlement.plst file.

  • Step: first select the project in xcode, create a file. Select a file with a codename named ititle.plist (default name).
  • Put it in the resources folder.
  • Right-click in the xml editor view.
  • Then open the provisioning file, for example, your_apllicationName.mobileprovision (which you created for the Apns server) in text mode.

Now copy the following lines from the following profile into your rights file:

 <key>application-identifier</key> <string>xyz.com.company_name.app_name</string> <key>aps-environment</key> <string>development</string> <key>get-task-allow</key> <true/> <key>keychain-access-groups</key> <array> <string>xyx.*</string> </array> 
  • Save the .plist file.
  • Launch the application that you report to the Apns server.
+1
Mar 30 '12 at 10:59
source share

enter image description here

Make the profile right. Can you not customize the profile.

+1
Jun 11 '14 at 10:54 on
source share

For me → go to project settings → target program → Features

enable push notifications!

+1
Jan 4 '17 at 12:54 on
source share

Just make sure you use a special certificate certificate

go to: https://developer.apple.com/ios/manage/provisioningprofiles/index.action check the status of your certificate of provision, in the worst case, just create a new one, upload it and assign it to your project again.

Make sure what type of software you use, “development” or “distribution”

0
Dec 15
source share

I have the same error in Xcode 4.6.1, it worked for me, then I delete the previous APNS profiles from the Mac and re-download the APNS Provisioing profile from the member center. In the build settings in target mode, code signature identification should be performed only in debug mode, since the developer of the iphone places it as zero or removes the developer or distribution kit for release.

0
Sep 26 '13 at 7:22
source share

I have that too. This is how I decided.

1) Remote provisioning profiles in ~/Library/MobileDevice/Provisioning Profiles

2) Deleted profiles from the developer account

3) Created and installed new profiles

Please note that the regeneration of the profiles did not dare.

0
Feb 12 '15 at 7:47
source share

ok, a little awkward, but sometimes you spend hours on the most idiotic mistakes -

so I run the application in DEBUG mode instead of AD-HOC .

to change this do:

scheme → Change scheme ...

select Run on the left and select Ad-Hoc dist in the Build Configuration section.

*, of course, you need to have a suitable adhoc provisioning profile when installing the assembly \ code signing, as well as the corresponding APNS certificate attached to it when creating the provisioning profile.

** after starting it, it will be crushed because it does not work in DEBUG mode, but you can still run it from the device.

enter image description here

0
Jul 21 '15 at 11:54
source share

If you are managing multiple applications on the same server, consider the following facts.

You need to process the separate private key as a p12 file in order to prepare the pem file, and this private key is created in the keychain application when you create the .certSigningRequest file. Thus, this CSR can be reused for one application upon expiration, but a separate application is required for any other application.

0
Oct. 31 '15 at 6:21
source share



All Articles