我正在Android应用程序中搜索推送通知。我检查了“Pushwoosh”:在initPushwoosh
方法中我看到了GOOGLE_PROJECT_ID
和PUSHWOOSH_APP_ID
。在Android和Phonegap中推送通知
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文档中看到了通知,它是否推送通知?
谢谢。
谢谢,pushwoosh远程API的用途是什么?因为我无法使用免费帐户访问它 – Viswa
没错,您必须至少有一个高级帐户:http://www.pushwoosh.com/accounts-comparison/使用远程API您可以使用远程API发送自定义数据请求,例如您可以将通知发送到特定设备。祝你好运! – weerd2
有推送通知的任何开源吗? – Viswa