upadte js event 'jpush.receiveNotification'

This commit is contained in:
zhangqinghe 2015-03-10 16:58:09 +08:00
parent 27c4fe7b26
commit a197975d03

View File

@ -507,8 +507,39 @@ iOS
#####返回值
#### event - jpush.receiveNotification
当iOS收到的通知时会触发这个事件
##### 事件定义
cordova.fireDocumentEvent('jpush.receiveNotification',json)
#####平台
iOS
#####使用说明
- 在你需要接收通知的的js文件中加入:
document.addEventListener("jpush.openNotification", onOpenNotification, false);
- onOpenNotification需要这样写
var onOpenNotification = function(event){
try{
var alert = event.alert;
var extras = event.extras;
console.log(alert);
//console.log(extras);
}
catch(exeption){
console.log(exception)
}
}
#####返回值
#### API - init