wangfukang 2 weeks 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