Meteor raix:推送:通知设置中只有“徽章”而不是“徽章,声音,横幅”

时间:2015-11-04 15:59:00

标签: meteor push-notification

在“设置”应用的“通知”部分中,我的应用只在其下方列出了“徽章”,其中应包含“徽章,声音,横幅”。

由于这个原因,我不会在收到新通知时收到“通知”,即没有横幅,没有声音,没有振动。通知显示在通知托盘和锁定屏幕上,徽章编号更新,但没有警报。

任何想法如何解决这个问题?

我的config.push.json看起来像这样:

{
"apn": { 
"passphrase": "passphrase",
 "key": "PushChatKey.pem",
 "cert": "PushChatCert.pem"
},
 "production":false, 
"badge": true,
 "sound": true,
 "alert": true,
 "vibrate": true
}

我发送这样的通知:

`Push.send({
from: 'Test',
title: 'Hello',text: 'World',
badge: 4,
query: {},
sound: 'default'
});`

(与iOS push notifications only showing badges. need sounds and banners too类似,但使用不同的框架。)

1 个答案:

答案 0 :(得分:1)

我能够使用服务器和客户端上的Push.Configure({})设置来解决这个问题。

服务器代码:

Push.Configure({
    apn:{
        passphrase:'password',
        certData: Assets.getText('enter certificate pem file name'),
        keyData: Assets.getText('enter key pem file name')
    },
    production: false //or true if production
});

客户端代码(包括警告:true是我的诀窍):

Push.Configure({
    badge:true,
    sound:true,
    alert:true
});