node.js apn 使用 (ios 消息推送 node 版)

node.js 服務(wù)器下使用node-apn 做 ios 消息推送

https://github.com/node-apn/node-apn
新版本的node-apn 用的是p8證書(shū) google 了大半天....終于成功了。

https://solarianprogrammer.com/2017/02/14/ios-remote-push-notifications-nodejs-backend/

p8證書(shū) 的生成 及使用:
Generate an APNs Auth Key
The next step involves generating an authentication key that will allow your backend server to authenticate with APNs when it wants to send one or more of your devices a push notification.
Up until a few months ago, the alternative to this was a painful process that involved filling out a Certificate Signing Request in Keychain Access, uploading it to the Developer Center, downloading a signed certificate, and exporting its private key from Keychain Access (not to mention converting both certificates to .pem
format). This certificate would then expire and need to be renewed every year and would only be valid for one deployment scheme: Development or Production.
Thankfully, Apple has greatly simplified the process of authenticating with APNs with the introduction of APNs Auth Keys, which never expire (unless revoked by you) and work for all deployment schemes.
Open the Keys -> All page in your Developer Center and click the +
button to create a new Auth Key.

Auth Keys

In the next page, enter a name for your key, enable APNs and click Continue at the bottom of the page.
APNs Selection

Finally, click Confirm in the next page. Apple will then generate a .p8
key file containing your APNs Auth Key.
Download Key

Download the .p8
key file to your computer and save it for later. Also, be sure to write down the Key ID somewhere, as you'll need it later when connecting to APNs.

詳細(xì)說(shuō)明如下地址:
https://eladnava.com/send-push-notifications-to-ios-devices-using-xcode-8-and-swift-3/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容