推送通知在Android和PhoneGap的 [英] Push notification in Android and Phonegap
问题描述
我正在寻找在Android应用程序推送通知。我检查了 Pushwoosh :在 initPushwoosh
方法,我看到 GOOGLE_PROJECT_ID
和 PUSHWOOSH_APP_ID
。
I am searching for push notification in Android applications. I checked "Pushwoosh": in the initPushwoosh
method I saw GOOGLE_PROJECT_ID
and 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?或者有没有更好的方式来做到这一点?
How can I get these two IDs? Or is there any better way to do this?
我看到通知在PhoneGap的文档,它是推送通知?
i saw Notification in PhoneGap documentation, Is it push notification?
感谢你。
推荐答案
的PhoneGap的通知已无关,与推送通知。检查在这里:的http://docs.phonegap.com/en/2.2.0/cordova_notification_notification.md.html#Notification
Phonegap's Notification has nothing to do with push notification. Check it here: http://docs.phonegap.com/en/2.2.0/cordova_notification_notification.md.html#Notification
要与PhoneGap的集成Pushwoosh为Android查手册:的http://www.pushwoosh.com/programming-push-notification/android-gcm-push-notifications-guide/
To integrate Pushwoosh for Android with Phonegap check the manual: http://www.pushwoosh.com/programming-push-notification/android-gcm-push-notifications-guide/
在这个页面更指南,使用Pushwoosh:
http://www.pushwoosh.com/programming-push-notification/
On this page are more guides for using Pushwoosh:
http://www.pushwoosh.com/programming-push-notification/
好运!
这篇关于推送通知在Android和PhoneGap的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!