Commit 795edb77 authored by 李晓兵's avatar 李晓兵

'jpush'

parent bc4ee610
......@@ -122,6 +122,9 @@ let backButtonPressedOnceToExit
vum.$vumPlatform.ready(function () {
if ((vum.Platform.isAndroid()) || (vum.Platform.isIOS())) {
/* window.getRegistrationID = function (callback){
callback('')
}*/
try {
setTimeout(function () {
navigator.splashscreen.hide()
......
......@@ -471,6 +471,8 @@ export default {
}
},
})
} else{
hlsPopup.showLongCenter('比对失败')
}
})
},
......
......@@ -4,16 +4,24 @@
export default {
// 获取设备号
onGetRegistrationID: function (data) {
let vm = this
try {
alert("JPushPlugin:registrationID is " + JSON.stringify(data));
if (data.length != 0) {
if (data) {
alert('111')
window.localStorage.setItem('registrationID', data)
}
if (data.length == 0) {
window.setTimeout(this.getRegistrationID, 1000)
if (!data) {
alert('222')
window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID.bind(vm))
//window.setTimeout(() => this.getRegistrationID(),1000)
/* window.setTimeout(function () {
vm.getRegistrationID()
}, 1000)*/
}
} catch (exception) {
alert('###'+JSON.stringify(exception));
alert('###'+exception);
}
},
// 获取设备号
......@@ -66,7 +74,7 @@ export default {
if (process.env.isMobilePlatform) {
window.plugins.jPushPlugin.init()
window.plugins.jPushPlugin.setDebugMode(false)
window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID)
window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID.bind(this))
document.addEventListener('jpush.openNotification', this.onOpenNotification)
window.plugins.jPushPlugin.resetBadge()// 设置Badge
window.plugins.jPushPlugin.setApplicationIconBadgeNumber(0)
......
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment