1
votes

I stuck at IOS push notification these few days. Here is my scenario:-

  1. Using Easy APNS Provider and push notification by using aps.cer (download from App ID > Production SSL Certificate) , it can receive successfully. enter image description here

  2. Using APNS & GCM Online Tester and push notification by using .pem file (generated in keychain > export to .p12 > convert to .pem file) , it can receive successfully. enter image description here

  3. Using Push Tester and push notification by using .pem file (same as above), an error message will be shown as below. enter image description here

  4. When putting the .pem file in my server end (PHP), it does not work as well. But it is fine when sandbox testing (developmentPush.pem).

Any idea, please help and alert me what I missed out. Appreciated!

2
try to send push from this and check pushtry.comNikunj Kumbhani
@NikunjKumbhani i getting this error "The credentials supplied to the package were not recognized"Eddy
Please check my answerNikunj Kumbhani
How do you get the device token? what function do you use?Mohamed Jaafar
@MohamedJaafar i get device token in this function:-didRegisterForRemoteNotificationsWithDeviceToken --> iOSDeviceToken = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""];Eddy

2 Answers

1
votes

I think you have an issue in export .p12 certificate here I can see in export screenshot display Export 2 items.

Don't select the private key to an export .p12 certificate.

enter image description here

check with .p12

Can't Update the name of Certificates

enter image description here

0
votes

In summary, here are some steps to take care when perform IOS push notification:-

  1. Enable server port / Request your server provider to enable APS port (example Port 2195)
  2. Ensure push notification function is enable in Apple Connect
  3. Change URL from gateway.sandbox.push.apple.com:2195 to gateway.push.apple.com, port 2195 in your backend server.
  4. Make sure your APS key download and convert to .PEM file correctly.
  5. Do not mixed PRODUCTION and DEVELOPMENT device token together when send it to APNS. It will cause failure as well.