user1242321
user1242321

Reputation: 1696

Unable to push notifications via urbanairship to APNS

I am using the APNS for my app in development mode. I integrated with the Urban Airship as per the getting started document they provided on their portal:

Created the certificate in Apple provisioning portal. Imported the .p12 file to Urban Airship app(in dev mode with debug enabled)

Now when I open the application, it shows me the alert and asks me for the permission to enable notification. Once that is done and I try to test push a message from the Urban Airship portal to my device using the device token generated, I get the common error:

Apple Push service rejected device token "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

I searched on google and found this to be a very common problem; however with no solution. Most answers mention that the prod and dev environment conflict is the cause, however that is not the case in my case as I did not create the prod app in Urban Airship nor in the APNS dev certificate. The settings in my AirshipConfig.plist are:

APP_STORE_OR_AD_HOC_BUILD : NO  
Development_App_Key: XXXXXXXXXXX   
Development_App_secret: XXXXXXXXXX  

(not master secret, just the dev app secret.)

Nowhere did I find the response from any user who asked the question and later got it resolved. So, I am not sure how people resolved it when they got stuck. All suggests to recheck the environment conflicts, which is not there in my case.

If anyone has any idea, please suggest the possible solutions as this is a blocker for our release. Pls also respond if this is a generic error which almost everyone gets with Urban Airship, and if Free UA account is not a feasible service for testing.

Upvotes: 2

Views: 1988

Answers (1)

Matt Carrier
Matt Carrier

Reputation: 5992

I've been fighting with these issues the last few days. The thing that fixed it for me was creating a non-wildcard identifier that was using a development provisioning profile.
Until I did this I was only able to have APP_STORE_OR_AD_HOC_BUILD : YES

Things worth checking:

  • Provisioning profile is set to development
  • Application bundle ID matches the Urban Airship bundle Id.
    You can check the Urban Airship bundle Id that is used by going to:
    1. Settings
    2. API Keys
      (See the right hand side and there should be a box that contains the iOS Bundle ID.)
  • Finally make sure your keys in the plist all match.

Also as you probably know, you cannot test push notifications with the simulator. I Hope this helps.

Upvotes: 4

Related Questions