【问题标题】:Meteor raix:push: Only "Badges" instead of "Badges, Sounds, Banners" in Notifications settingsMeteor raix:push:通知设置中只有“徽章”而不是“徽章、声音、横幅”
【发布时间】:2015-11-04 15:59:00
【问题描述】:

在“设置”应用的“通知”部分中,我的应用只列出了“徽章”,而它应该有“徽章、声音、横幅”。

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

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

我的 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,但使用不同的框架。)

【问题讨论】:

    标签: meteor push-notification


    【解决方案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
    });
    

    客户端代码(包括 alert:true 对我有用):

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

    【讨论】:

    • 节省了我的工作时间!希望 RAIX 更新后这不会中断。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-20
    • 2022-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多