Cordova phonegap推送通知显示为警报,而不是推送通知

Cordova phonegap推送通知显示为警报,而不是推送通知,cordova,push-notification,pushwoosh,Cordova,Push Notification,Pushwoosh,我正在使用Phonegap推送插件+推送插件 我有一个问题:当应用程序关闭时,我没有收到任何推送通知, 当应用程序打开时,我会得到一个提醒 我想在这两种情况下都得到推送通知 我的onDeviceReady功能是: function onDeviceReady() { var pushNotification; try { pushNotification = window.plugins.pushNotification; if (isAn

我正在使用Phonegap推送插件+推送插件 我有一个问题:当应用程序关闭时,我没有收到任何推送通知, 当应用程序打开时,我会得到一个提醒

我想在这两种情况下都得到推送通知

我的onDeviceReady功能是:

function onDeviceReady()
{
    var pushNotification;
    try
    {
        pushNotification = window.plugins.pushNotification;
        if (isAndroid())
        {
            pushNotification.register(successHandler, errorHandler, {"senderID":"179400841357","ecb":"onNotificationGCM"});     // required!
        }
        else
        {
            pushNotification.register(tokenHandler, errorHandler, {"badge":"true","sound":"true","alert":"true","ecb":"onNotificationAPN"});    // required!
        }
    }
    catch(err)
    {
        txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.message + "\n\n";
        alert(txt);
    }
}
onNotificationGCM功能:

function onNotificationGCM(e)
{
    switch( e.event )
    {
        case 'registered':
            if ( e.regid.length > 0 )
            {
                //alert("entering to pushwoosh");
                // 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 = "94550-3136B";
                PushWoosh.register(e.regid, function(data)
                {
                    console.log("PushWoosh register success: " + JSON.stringify(data));
                    //alert("succeded");
                }, function(errorregistration) {
                    console.log("Couldn't register with PushWoosh" +  errorregistration);
                    //alert("oh shit!");
                });

            }
            break;

        case 'message':
            navigator.notification.alert(e.payload);
            // if this flag is set, this notification happened while we were in the foreground.
            // you might want to play a sound to get the user's attention, throw up a dialog, etc.
            if (e.foreground)
            {
                // if the notification contains a soundname, play it.
                var my_media = new Media("/android_asset/www/"+e.soundname);
                my_media.play();
            }

            break;

        default:
            break;
    }
}
谢谢