|
|
|
@ -391,16 +391,24 @@ |
|
|
|
}, |
|
|
|
getNotificationEnabled() { |
|
|
|
if (uni.getSystemInfoSync().platform == "ios") { |
|
|
|
if (!jpushModule.requestNotificationAuthorization) return; |
|
|
|
if (!jpushModule.requestNotificationAuthorization) { |
|
|
|
console.log('JPush requestNotificationAuthorization is unavailable'); |
|
|
|
return; |
|
|
|
} |
|
|
|
jpushModule.requestNotificationAuthorization((result) => { |
|
|
|
console.log('JPush notification authorization:', JSON.stringify(result)); |
|
|
|
let status = result.status |
|
|
|
if (status < 2) { |
|
|
|
this.noticMsgTool() |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (!jpushModule.isNotificationEnabled) return; |
|
|
|
if (!jpushModule.isNotificationEnabled) { |
|
|
|
console.log('JPush isNotificationEnabled is unavailable'); |
|
|
|
return; |
|
|
|
} |
|
|
|
jpushModule.isNotificationEnabled((result) => { |
|
|
|
console.log('JPush notification enabled:', JSON.stringify(result)); |
|
|
|
if (result.code == 0) { |
|
|
|
this.noticMsgTool() |
|
|
|
} |
|
|
|
|