开发者

Getting an error from push notification

In my app, I need push notifications. I am implementing all the instructions from the push notifications docs. But I got an error from Push Notification:

Fail To Register For Rem开发者_如何转开发ote 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 I am doing wrong?


Generate a new provisioning profile, after you enable Push, and it will work!


I am using Xcode 6.1.1

You don't have to delete or recreate anything. You just have to make Xcode update your active certificates (including the new push notification certificate).

Simply go to Xcode > Preferences > Accounts > pick your Account > pick your Team > View Details

There click the refresh button in the lower left corner. (Also check your code signing in build settings)

Getting an error from push notification


I had same problem,

I solved it making sure in Built Settings, Code Signing Identity for debug is set to proper Provisioning Profile

in which you enabled push notifications.


First, you need to make sure you use an app ID without a wildcard. Then you need to enable that app for push notifications for development.

Check this tutorial, for example.

Even after you've enabled your app id for push, it might take a couple of hours for it to work.


That was making me crazy. I cross-checked everything but still was getting the same error. Tried all the other solution given on the web as well. However, this did the trick for me. I create .mobileprovision file before enable APNS. This was the real mistake. Resolution of this problem :

  1. Create App ID
  2. Enable APNS
  3. Then create Provision File

If you have created provisioning profile earlier and the you have enabled APNS , you should delete provisioning file from everywhere in your system(XCode,keychain,iTuneConnect). And then create provisioning file again.


I just dealt with this issue. While there are probably a lot of things going on, here is what I learned.

When you make changes to an app ID, such as enabling push notifications, you need to create a new provisioning profile. I must have created my app ID, made a provisioning profile using it and then enabled notifications on the app ID.

Once I removed the provisioning profile from the portal, and device, I made a new one using the modified app ID. Downloaded it, tossed it on my device, wham bam thank you ma'am it worked. Hope this helps people in the future!


This just solved it for me so I will share. If you update your app id you then must delete the profile from your device, xcode, and developer.apple.com. Then create a new matching provisioning profile that is updated with the new app id settings. Its best to name it something slightly different so you know you are selecting the correct one.


First thing you have to run applcaiton in device.

This is will happen in xcode 3.2.6. Because when you are getting everything perfect. But your application is not registering in your iphone, ipad or ipod. You need to generate a Entitlement.plst file.

  • Step: First select your project in xcode create a file. Select codesign file named it entitlement.plist(default name).
  • Put it on resource folder.
  • Right click open as xml editor.
  • Then open your provisionfile like your_apllicationName.mobileprovision (which you have created for Apns server ) in textedit mode.

Now copy some lines like the following from your provisioning profile into your entitlements 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 entitlement.plist file.
  • Run your applcation you will notify by Apns server.


Getting an error from push notification

Make the Profile right.Maybe you do not set the profile.


For me -> go to project settings -> app target -> Capabilities

enable Push Notifications!


Just make sure that you are using the specific provision certificate

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

Make sure which type of provision you are using, "development" or "distribution"


I got same too. Here is how I solved.

1) Deleted provisioning profiles at ~/Library/MobileDevice/Provisioning Profiles

2) Deleted profiles from Developer Account

3) Created and installed new profiles

Note that regenarating of profiles didn't solve.


ok, a little embarrassing, but sometimes you spend hours on the most idiotic bugs -

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

to change that, do:

scheme -> Edit Scheme...

select Run on the left, and change to Ad-Hoc dist under Build Configuration.

*of course you need to have the suitable adhoc provisioning profile under build-setting\code signing as well as the suitable APNS certificate attached to it when you create the provisioning profile.

** once you run it, it'll crush cause its not on DEBUG mode, but you can still run in from the device.

Getting an error from push notification


If you're managing more than one apps pushes on one server then consider the following facts.

You need to process a separate private key as a p12 file to prepare pem file and this private key is generated in keychain app when you create a .certSigningRequest file. So, this CSR can be reused for same app upon expiration but a separate is needed for any other app.


I got same error in XCode 4.6.1, It worked for me then I delete the previous APNS profiles from the Mac and redownload the APNS provisioing profile from member center. In Build Settings at target mode, Code Signing Identity should only in Debug Mode as iphone Developer for Release put as nil or delete the developer or distribution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜