|
|
|
@ -103,13 +103,15 @@ |
|
|
|
this.getAreaSize() |
|
|
|
// this.getRegistrationID() |
|
|
|
// #ifdef APP-PLUS |
|
|
|
jpushModule.initJPushService(); |
|
|
|
|
|
|
|
jpushModule.setLoggerEnable(true); |
|
|
|
plus.screen.lockOrientation("portrait-primary"); |
|
|
|
if (jpushModule.setLoggerEnable) { |
|
|
|
jpushModule.setLoggerEnable(true); |
|
|
|
} |
|
|
|
if (plus && plus.screen && plus.screen.lockOrientation) { |
|
|
|
plus.screen.lockOrientation("portrait-primary"); |
|
|
|
} |
|
|
|
//监听 极光推送连接状态 |
|
|
|
this.getNotificationEnabled(); |
|
|
|
jpushModule.addConnectEventListener(result => { |
|
|
|
console.log('JPush connect event:', JSON.stringify(result)); |
|
|
|
let connectEnable = result.connectEnable |
|
|
|
if (connectEnable == true) { |
|
|
|
setTimeout(() => { |
|
|
|
@ -120,6 +122,7 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
jpushModule.addNotificationListener(result => { //极光推送的消息通知回调 |
|
|
|
console.log('JPush notification event:', JSON.stringify(result)); |
|
|
|
if (jpushModule.setBadge) { |
|
|
|
jpushModule.setBadge(0); |
|
|
|
} |
|
|
|
@ -182,6 +185,11 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
if (jpushModule.initJPushService) { |
|
|
|
console.log('JPush init service'); |
|
|
|
jpushModule.initJPushService(); |
|
|
|
} |
|
|
|
this.getNotificationEnabled(); |
|
|
|
if (jpushModule.isPushStopped) { |
|
|
|
jpushModule.isPushStopped(res => { |
|
|
|
// code 0已停止推送 1未停止推送 |
|
|
|
|