wangfukang 2 months ago
parent
commit
35c9020e93
  1. 18
      App.vue

18
App.vue

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

Loading…
Cancel
Save