【发布时间】:2013-07-31 02:56:45
【问题描述】:
我正在使用这个 Ruby 脚本来发送推送通知:
APNS.host = 'gateway.push.apple.com'
APNS.port = 2195
APNS.pem = 'CERTIFICATE_PATH
APNS.pass = '56895689aA'
device_token = TOKEN
APNS.send_notification(device_token, :alert => 'Message', :badge => 1, :sound => 'beep.wav')
我正在像这样的设备(它的 Phonegap)上处理它
onAPNNotification: function (event) {
var pushNotification = window.plugins.pushNotification;
if (event.alert) {
navigator.notification.alert(event.alert);
}
if (event.badge) {
console.log("Set badge on " + pushNotification);
pushNotification.setApplicationIconBadgeNumber(this.onGCMRegisterSuccess, event.badge);
}
if (event.sound) {
var snd = new Media(event.sound);
snd.play();
}
}
一切正常,我收到了通知,但我想知道是否有隐藏数据,以便在通知到达时不会显示(并显示带有通知中一些文本的警报)。
我们将不胜感激。
【问题讨论】:
标签: javascript cordova push-notification phonegap-build