Après Apple a changé la APNs Auth clé de p8, les bibliothèques actuelles telles que https://github.com/immobiliare/ApnsPHP utilisent encore les anciens fichiers de GDP et cert pour se connecterComment se connecter à apn avec PHP en utilisant le fichier clé p8 auth
$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()
Avec nœud. exemple js (https://eladnava.com/send-push-notifications-to-ios-devices-using-xcode-8-and-swift-3/), je pourrais envoyer comme ceci:
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
});
Comment puis-je utiliser PHP pour envoyer des notifications à distance à iOS comme je le fais dans Node.js?
Avez-vous une solution? :) – Maximus1809
@ Maximus1809 pas encore :) – mehmetsen80
Je cherche un moyen de faire cela aussi, on dirait que je vais devoir faire une solution –