|
|
|
@ -120,8 +120,12 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
jpushModule.addNotificationListener(result => { //极光推送的消息通知回调 |
|
|
|
jpushModule.setBadge(0); |
|
|
|
plus.runtime.setBadgeNumber(0); |
|
|
|
if (jpushModule.setBadge) { |
|
|
|
jpushModule.setBadge(0); |
|
|
|
} |
|
|
|
if (plus && plus.runtime && plus.runtime.setBadgeNumber) { |
|
|
|
plus.runtime.setBadgeNumber(0); |
|
|
|
} |
|
|
|
let notificationEventType = result.notificationEventType |
|
|
|
let woopId = result.extras && result.extras.dataType === 'woop' && result.extras.value; |
|
|
|
const content = result.content || '' |
|
|
|
@ -178,12 +182,14 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
jpushModule.isPushStopped(res => { |
|
|
|
// code 0已停止推送 1未停止推送 |
|
|
|
const { |
|
|
|
code |
|
|
|
} = res |
|
|
|
}) |
|
|
|
if (jpushModule.isPushStopped) { |
|
|
|
jpushModule.isPushStopped(res => { |
|
|
|
// code 0已停止推送 1未停止推送 |
|
|
|
const { |
|
|
|
code |
|
|
|
} = res |
|
|
|
}) |
|
|
|
} |
|
|
|
//#endif |
|
|
|
|
|
|
|
|
|
|
|
@ -377,6 +383,7 @@ |
|
|
|
}, |
|
|
|
getNotificationEnabled() { |
|
|
|
if (uni.getSystemInfoSync().platform == "ios") { |
|
|
|
if (!jpushModule.requestNotificationAuthorization) return; |
|
|
|
jpushModule.requestNotificationAuthorization((result) => { |
|
|
|
let status = result.status |
|
|
|
if (status < 2) { |
|
|
|
@ -384,6 +391,7 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (!jpushModule.isNotificationEnabled) return; |
|
|
|
jpushModule.isNotificationEnabled((result) => { |
|
|
|
if (result.code == 0) { |
|
|
|
this.noticMsgTool() |
|
|
|
|