|
@@ -3,6 +3,7 @@ import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
|
|
|
import { usePageAuth } from '@/hooks/usePageAuth'
|
|
|
import { t } from '@/locale'
|
|
|
import { useUserStore } from '@/store'
|
|
|
+import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
|
|
|
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
|
|
|
|
|
|
const mtpushModule = uni.requireNativePlugin('EL-MTPush')
|
|
@@ -16,6 +17,7 @@ onLaunch(() => {
|
|
|
if (isLoggedIn.value) {
|
|
|
userStore.getUserInfo()
|
|
|
}
|
|
|
+
|
|
|
if (uni.getSystemInfoSync().platform === 'ios') {
|
|
|
mtpushModule.requestNotificationAuthorization((result) => {
|
|
|
const status = result.status
|
|
@@ -39,55 +41,55 @@ onLaunch(() => {
|
|
|
uni.$emit('connectStatusChange', connectEnable)
|
|
|
})
|
|
|
|
|
|
- mtpushModule.addNotificationListener((result) => {
|
|
|
- const notificationEventType = result.notificationEventType
|
|
|
- const messageID = result.messageID
|
|
|
- const title = result.title
|
|
|
- const content = result.content
|
|
|
- const extras = result.extras
|
|
|
-
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: JSON.stringify(result),
|
|
|
- duration: 3000,
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- mtpushModule.addCustomMessageListener((result) => {
|
|
|
- const type = result.type
|
|
|
- const messageType = result.messageType
|
|
|
- const content = result.content
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: JSON.stringify(result),
|
|
|
- duration: 3000,
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- mtpushModule.addTagAliasListener((result) => {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: JSON.stringify(result),
|
|
|
- duration: 3000,
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- if (uni.getSystemInfoSync().platform === 'ios') {
|
|
|
- mtpushModule.addLocalNotificationListener((result) => {
|
|
|
- const messageID = result.messageID
|
|
|
- const title = result.title
|
|
|
- const content = result.content
|
|
|
- const extras = result.extras
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: JSON.stringify(result),
|
|
|
- duration: 3000,
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- // app更新
|
|
|
+ // mtpushModule.addNotificationListener((result) => {
|
|
|
+ // const notificationEventType = result.notificationEventType
|
|
|
+ // const messageID = result.messageID
|
|
|
+ // const title = result.title
|
|
|
+ // const content = result.content
|
|
|
+ // const extras = result.extras
|
|
|
+
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: JSON.stringify(result),
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+
|
|
|
+ // mtpushModule.addCustomMessageListener((result) => {
|
|
|
+ // const type = result.type
|
|
|
+ // const messageType = result.messageType
|
|
|
+ // const content = result.content
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: JSON.stringify(result),
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+
|
|
|
+ // mtpushModule.addTagAliasListener((result) => {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: JSON.stringify(result),
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+
|
|
|
+ // if (uni.getSystemInfoSync().platform === 'ios') {
|
|
|
+ // mtpushModule.addLocalNotificationListener((result) => {
|
|
|
+ // const messageID = result.messageID
|
|
|
+ // const title = result.title
|
|
|
+ // const content = result.content
|
|
|
+ // const extras = result.extras
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: 'none',
|
|
|
+ // title: JSON.stringify(result),
|
|
|
+ // duration: 3000,
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // }
|
|
|
})
|
|
|
onShow(() => {
|
|
|
+ checkUpdate()
|
|
|
console.log('App Show')
|
|
|
})
|
|
|
onHide(() => {
|