From a197975d03bfa2e7180c8280ce07e2be266e37b3 Mon Sep 17 00:00:00 2001 From: zhangqinghe Date: Tue, 10 Mar 2015 16:58:09 +0800 Subject: [PATCH] upadte js event 'jpush.receiveNotification' --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 7078c8e..b0b40b7 100644 --- a/README.md +++ b/README.md @@ -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