我可以使用APNauthentication密钥.p8文件与PHP发送iOS推送通知?

我的推送通知停止与最近的更新之一。 当我进一步研究它时,我发现苹果现在可以让你生成一个非失效的APNsauthentication密钥,它可以用于生产和testing。 我有它使用下面的node.js脚本:

var apn = require('apn'); // Set up apn with the APNs Auth Key var apnProvider = new apn.Provider({ token: { key: 'apns.p8', // Path to the key p8 file keyId: '<my key id>', // The Key ID of the p8 file (available at https://developer.apple.com/account/ios/certificate/key) teamId: '<my team id' // 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 }); // Enter the device token from the Xcode console var deviceToken = '<my device token>'; // Prepare a new notification var notification = new apn.Notification(); // Specify your iOS app's Bundle ID (accessible within the project editor) notification.topic = '<my bundle id'; // Set expiration to 1 hour from now (in case device is offline) notification.expiry = Math.floor(Date.now() / 1000) + 3600; // Set app badge indicator notification.badge = 3; // Play ping.aiff sound when the notification is received notification.sound = 'ping.aiff'; // Display the following message (the actual notification text, supports emoji) notification.alert = 'This is a test notification \u270C'; // Send any extra payload data with the notification which will be accessible to your app in didReceiveRemoteNotification notification.payload = {id: 123}; // Actually send the notification apnProvider.send(notification, deviceToken).then(function(result) { // Check the result for any failed devices console.log(result); process.exit(0) }); 

有没有办法使用新的APNauthentication密钥与PHP? 我可以从PHP调用node.js脚本,使用exec("node app.js &", $output); ,它的工作,但它开始变得丑陋。 如果PHP仍然使用旧的.pem文件方法?