【文件属性】:
文件名称:apns2:节点客户端,用于使用带有JSON Web令牌的新HTTP2协议连接到Apple的Push Notification Service
文件大小:41KB
文件格式:ZIP
更新时间:2021-05-17 04:59:36
nodejs ios apple promise http2
APNS2
使用带有JSON Web令牌的新HTTP / 2协议连接到Apple的Push Notification Service的节点客户端。
创建客户
使用签名密钥创建一个APNS客户端:
const { APNS } = require ( 'apns2' )
const client = new APNS ( {
team : `TFLP87PW54` ,
keyId : `123ABC456` ,
signingKey : fs . readFileSync ( ` ${ __dirname } /path/to/auth.p8` ) ,
defaultTopic : `com.tablelist.Tablelist`
} )
发送通知
基本的
发送带有消息的基本通知:
const { BasicNotification } = require ( '
【文件预览】:
apns2-main
----.eslintrc.json(218B)
----.github()
--------workflows()
----yarn.lock(62KB)
----lib()
--------apns.js(5KB)
--------notifications()
--------errors.js(1KB)
--------http2-client.js(4KB)
----.prettierrc.json(91B)
----LICENSE(1KB)
----test()
--------test.js(4KB)
----README.md(4KB)
----index.d.ts(3KB)
----.gitignore(46B)
----CHANGELOG.md(4KB)
----package.json(915B)