【发布时间】:2023-03-03 21:12:01
【问题描述】:
我正在尝试将这个 Push Meteor 包用于 Android 和 Chrome 推送通知。我按照basic instructions 将 GCM 凭据添加到根目录下的 config.push.json 文件中。
我尝试使用以下命令为浏览器、Android 模拟器和 Android 手机发送推送通知。
Push.send({
from: 'Test',
title: 'Hello',
text: 'World',
count: 12,
query: {
userId: 'xxxxxxxxxxxx'
}
});
当我在浏览器控制台中输入命令时,出现以下错误:
Uncaught TypeError: undefined is not a function
notifications.js:40
这似乎是因为没有登录用户。
在 Meteor Shell 上,我得到了一个令牌,但在这两种情况下都没有发送推送通知。
如果您对未发送推送通知的原因有任何想法,请告诉我。谢谢
【问题讨论】:
标签: cordova meteor push-notification phonegap-plugins google-cloud-messaging