Recently the app can not receive notification, the android side works fine but the ios one has fail
so here is what I have attempt:
1) generate token from apple apn service
2) create the endpoint at amazon backend
3) publish the message at amazon backend
4) it does not receive message and the endpoint will go to disabled after a while.
And I have checked the following:
1) try serveal ios device , including iphone/ ipad/ipod touch also the same result
2) checked the secret key/ platform arn it is matched
3) created another platform ARN but still the same.
So , what direction should I continue to debug , e.g. is the push notification cert ? which part of coding should I check, as it works before but only fail recently.
Thanks a lot.
Create your APNs sandbox(development) certificate(make sure you are selecting bundle identifier of your development certificate)
Once you create sandbox certificate, verify push notification service is enabled for your provisioning profile(you can not create provisioning profile with your APNS certificate, you have to use your provisioning profile created with development certificate)
If you have already installed development provisioning profile then delete is from following path "xcode-prefrences-select apple developer account - view details - provisiong profile"
Download development provisioning profile from member center and install it. Select newly installed profile and certificate
Login to Amazon SNS and select nearest location(at top right corner) as shown in below image with red oval. Change Location place
Under "Mobile Services" section select SNS (Push Notification Service )
Now you will be at SNS Home Screen, now select Application from side Menu
Click on "Create Platform Application". Enter application name then select Push Notification Platform as "Apple Development" and Push Certificate type as "iOS Push Certificate"
Now you have to upload privateKey.p12
Process to get privateKey.p12
To get privateKey.p12, download APNs(sandbox) certificate and install it in krychain. then open keychain Access and expand certificate then select name of developer account holder(it will have icon of key and Kind as "private key") Now right click on account holder name and click on export(enter password to file if you want or else leave it blank) then name is as privatekey.p12 and store it on desktop
Choose privateKey.p12 from desktop then enter password if you have set then click on "Load Certificate from File" then certificate and private key fields will be populated with values exported from privateKey.p12.
Click on "Create Application Platform", your new ios Application is created.
Click on ARN, it will go inside your app. now click on "Create Platform Endpoint"
Run your mobile app and get deviceToken
Enter device token in "Device token" field and give device name in user data. Now click on "Add Endpoint"
Select added endpoint and click on "Publish to Endpoint"
Select message format as per your need then enter your message then click on "Publish Message".
If the SNS endpoint is disabled after a while, that means your APNS certificate has some issue. Do you mistakenly use a sandbox certificate for prod, or visa versa? Do you have the right certificate and private key combo? See http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With