getIcoming in UrbanAirship for Phonegap

时间:2013-01-18 13:08:35

标签: javascript ios cordova urbanairship.com

当我的应用程序最小化时,当我在手机上收到推送通知时,如果我点击通知启动我的应用,请致电

window.pushNotification.getIncoming( callback )

返回{"message":"","extras":{}},而不是我点击的通知数据。

这是正确的行为吗?如果有,有办法获得我想要的信息吗?

1 个答案:

答案 0 :(得分:1)

使用以下代码进行PhoneGap推送通知

window.LocalNotification.add({
                    message : "hello",
                    ticker : "New Notification",
                    repeatDaily : false,
                    id : 4
                }, newNotification);


function newNotification(e) {
if (e != null && e.event == "newLocalNotification") {
    // add my Appointment page
    window.location = "#redirectPageId";

}

}

使用“redirectPageId”进行重定向页面