2014-05-13 63 views
0

我開發一個科爾多瓦(3.4.0)的應用程序都爲Android和iOS推送通知空。我正在整合城市飛艇推送通知。我從服務器發送推送消息和url。在android中,推送消息和額外功能已經正常發佈,但我在iOS中收到空的額外內容。我下面的城市飛艇的PhoneGap文件http://docs.urbanairship.com/build/phonegap.html科爾多瓦-IOS:演員是在接收與城市飛艇

代碼接收推送和額外

var handleIncomingPush = function(event) { 
        if(event.message) { 
        console.log("Incoming push: " + event.message) 
        //alert(event.message); 
        } else { 
        console.log("No incoming message") 
        } 
        if(event.extras.url) { 
        console.log("URL") 
        window.open(event.extras.url,'_blank','location=no,closebuttoncaption=Done,toolbar=yes,toolbarposition=bottom'); 
        } 
       } 

Playload是

Payload: {"aliases":["alias_xssh"],"aps":{"badge":"+1","extra":{"url":"http:\/\/jhe.com\/task.php?action=daily&username=ins-mobile&date=2014-05-12"},"alert":"This is subject"} 

當在Xcode接收登陸是

aps =  { 
    alert = "This is subject"; 
    badge = 16; 
    extra =   { 
     url = "http://jhe.com/task.php?action=daily&username=ins-mobile&date=2014-05-12"; 
    }; 
}; 

2014-05-13 20:00:36.072 ListCreator[974:60b] {"message":"This is subject","extras":{}} 

問題是在最後一行。 extras:{} is empty。這個代碼在Android中正確運行,但沒有在iOS中獲得額外的功能。

任何建議將高度讚賞。

感謝

回答

0

有效載荷應該像

Payload: "aps": {"alert": "This is subject", "badge": 1}, "url": "http:\/\/jhe.com\/task.php?action=daily&username=ins-mobile&date=2014-05-12" 

console.log(event.extras.url); 

希望這有助於