尝试在PhoneGap构建(Android)上实现Pushwoosh
我试图让我的通知工作,但我没有收到他们。我按照教程在phonegap构建中实现pushwoosh。我有谷歌提供的应用ID和API密钥,但在我重新安装应用时,我没有让应用所在的设备注册 我猜我的问题在以下代码中:尝试在PhoneGap构建(Android)上实现Pushwoosh,android,push-notification,phonegap-build,Android,Push Notification,Phonegap Build,我试图让我的通知工作,但我没有收到他们。我按照教程在phonegap构建中实现pushwoosh。我有谷歌提供的应用ID和API密钥,但在我重新安装应用时,我没有让应用所在的设备注册 我猜我的问题在以下代码中: // handle GCM notifications for Android function onNotificationGCM(e) { switch( e.event ) { case 'registered': if ( e.regid.length
// handle GCM notifications for Android
function onNotificationGCM(e) {
switch( e.event )
{
case 'registered':
if ( e.regid.length > 0 )
{
// Your GCM push server needs to know the regID before it can push to this device
// here is where you might want to send it the regID for later use.
PushWoosh.appCode = "YOUR_PUSHWOOSH_APP_ID"; // my pushwoosh id is here
PushWoosh.register(e.regid, function(data) {
alert("PushWoosh register success: " + JSON.stringify(data));
}, function(errorregistration) {
alert("Couldn't register with PushWoosh" + errorregistration);
});
}
break;
我在索引文件中的
标记中插入了此代码,但设备未注册导致此问题的原因
我还应该提到,我的javascript文件夹中有pushwoosh.js文件,我在.js
文件的引用标记中指向它