immobiliare/ApnsPHP

Apple push notification service server certificate update? (Help)

Closed this issue · 2 comments

ns23 commented

Hello

Below is the latest changes from Apple wrt to APNS.
Apple docs

Communication between your provider server and APNs must take place over a secure connection. Creating that connection requires installing the GeoTrust Global CA root certificate (until March 29, 2021) and the AAA Certificate Services root certificate (starting March 29, 2021) on each of your provider servers.

Below is my code snippet to connect to APNS using ApnsPHP

 $push = new ApnsPHP_Push(
                    ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION,
                    '/certificates/ios/prod/Certificates.pem'
                );
 $push->connect();

Can you kindly let me know if I need to make any changes in the code ? Or replace existing Certificates.pem with new certificate ?

BafS commented

You need to use the v2.0.0-alpha branch and need to make sure that the protocol is HTTP2, by default it's not.

 $push = new ApnsPHP_Push(
    ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION,
    '/certificates/ios/prod/Certificates.pem',
    ApnsPHP_Abstract::PROTOCOL_HTTP // Here we are using HTTP 2
);
 $push->connect();
ns23 commented

Okay ..thank you very much for answering my query.