Vis*_*swa 2 android push-notification sencha-touch cordova
我正在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);
});
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能获得这两个ID?或者有更好的方法吗?
我在PhoneGap文档中看到了Notification,它是推送通知吗?
谢谢.
这些是您必须执行的步骤:
GOOGLE_PROJECT_ID在Google API控制台中找到您的网址.通常它看起来像这样:https://code.google.com/apis/console/#project:12345678912:access在这个例子中,它将是:12345678912My Apps菜单PUSHWOOSH_APP_ID| 归档时间: |
|
| 查看次数: |
4752 次 |
| 最近记录: |