push notification from php server is not sent to ios

89 views Asked by At

I am using a php server that connect via

$fp = stream_socket_client(
'ssl://gateway.push.apple.com:2195', $err,
$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);

before submitting my app, I used ssl://gateway.sandbox.push.apple.com and everything worked fine. The push notifications worked normally.

However, after I submitted my app to appstore and the app was approved, the push notification started to not work. I have noticed that my .pem file was still development apns so I changed my .pem file in my server to Apple push services certificate and set it in my backend. However, the push notification is still not loading.

Now, even when I try to do this via development (connecting my phonen to xcode and running it there) the notification will not show up.. Do you guys have any clue on what the problem may be?

1

There are 1 answers

0
Sarthak Mishra On

Make sure you have created the production push notifications certificate in the apple developer portal. After that upload the .pem file to your server and replace the credentials and it should work.