phppush-notificationapple-push-notificationshttp2apns-php

Issuse with send notification with APNS HTTP/2 from PHP


Recent my certificate for push notification time out so I must create new certificate Universal Push Notification Client SSL Certificate. But when I update this my certificate, my php server can't push notification, Apple return error

Unable to set private key file

Seems problem come with recent update of Apple.

APNs Provider API

Apple Push Notification service includes the APNs Provider API that allows you to send remote notifications to your app on iOS, tvOS, and OS X devices, and to Apple Watch via iOS. This API is based on the HTTP/2 network protocol. Each interaction starts with a POST request, containing a JSON payload, that you send from your provider server to APNs. APNs then forwards the notification to your app on a specific user device.

Anyone faced with it can help me. If have sample I will very appreciate. Thank alot!


Solution

  • Finally I found out problem. Each certificate have an identity, so with new certificate have new identity. If you don't check it in code PHP, Apple will return error above. If anyone work with it and face same error, they should check it.