pushbullet.pushData() 函数
pushbullet.pushData() 将推送通知发送到 Pushbullet API。
函数类型签名
(data: A, ?token: B, ?url: string) => int
有关更多信息,请参见 Function type signatures。
参数
网址
PushBullet 端点的 URL。默认是 "https://api.pushbullet.com/v2/pushes"。
令牌
API令牌字符串。默认值是 "".
数据
(必需) 要发送到端点的数据。数据是 JSON 编码的,并发送到 Pushbullet 的端点。
有关如何构建数据,请参见Pushbullet API documentation。
示例
向Pushbullet发送推送通知
import "pushbullet"
pushbullet.pushData(
token: "mY5up3Rs3Cre7T0k3n",
data: {
"type": "link",
"title": "Example title",
"body": "Example nofication body",
"url": "http://example-url.com",
},
)