【发布时间】:2012-11-17 06:22:21
【问题描述】:
我正在 Android 应用程序中搜索推送通知。我检查了“Pushwoosh”:在initPushwoosh 方法中我看到了GOOGLE_PROJECT_ID 和PUSHWOOSH_APP_ID。
function initPushwoosh() {
var pushNotification = window.plugins.pushNotification;
pushNotification.registerDevice(
{
projectid: "GOOGLE_PROJECT_ID",
appid : "PUSHWOOSH_APP_ID"
},
function(status) {
var pushToken = status;
console.warn('push token: ' + pushToken);
},
function(status) {
console.warn(JSON.stringify(['failed to register ', status]));
}
);
document.addEventListener('push-notification', function(event) {
var title = event.notification.title;
var userData = event.notification.userdata;
if(typeof(userData) != "undefined") {
console.warn('user data: ' + JSON.stringify(userData));
}
navigator.notification.alert(title);
});
}
如何获得这两个 ID?或者有没有更好的方法来做到这一点?
我在 PhoneGap 文档中看到了通知,是推送通知吗?
谢谢。
【问题讨论】:
标签: android cordova sencha-touch push-notification