После того, как Apple изменила ключ аутентификации APN на p8, текущие библиотеки, такие как https://github.com/immobiliare/ApnsPHP по-прежнему использовать старые файлы pem и cert для подключения
$push = new ApnsPHP_Push(
ApnsPHP_Abstract::ENVIRONMENT_SANDBOX,
'server_certificates_bundle_sandbox.pem'
);
// Set the Provider Certificate passphrase
// $push->setProviderCertificatePassphrase('test');
// Set the Root Certificate Autority to verify the Apple remote peer
$push->setRootCertificationAuthority('entrust_root_certification_authority.pem');
// Connect to the Apple Push Notification Service
$push->connect()
На примере Node.js (https://eladnava.com/send-push-notifications-to-ios-devices-using-xcode-8-and-swift-3/), я мог бы отправить так:
var apnProvider = new apn.Provider({
token: {
key: 'APNsAuthKey_Q34DLF6Z6J.p8', // Path to the key p8 file
keyId: 'Q34DLF6Z6J', // The Key ID of the p8 file (available at https://developer.apple.com/account/ios/certificate/key)
teamId: 'RLAHF6FL89', // The Team ID of your Apple Developer Account (available at https://developer.apple.com/account/#/membership/)
},
production: false // Set to true if sending a notification to a production iOS app
});
Как я могу использовать PHP для отправки удаленных уведомлений на iOS, как в node.js?