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

'jpush'

parent bc4ee610
...@@ -122,6 +122,9 @@ let backButtonPressedOnceToExit ...@@ -122,6 +122,9 @@ let backButtonPressedOnceToExit
vum.$vumPlatform.ready(function () { vum.$vumPlatform.ready(function () {
if ((vum.Platform.isAndroid()) || (vum.Platform.isIOS())) { if ((vum.Platform.isAndroid()) || (vum.Platform.isIOS())) {
/* window.getRegistrationID = function (callback){
callback('')
}*/
try { try {
setTimeout(function () { setTimeout(function () {
navigator.splashscreen.hide() navigator.splashscreen.hide()
......
...@@ -471,6 +471,8 @@ export default { ...@@ -471,6 +471,8 @@ export default {
} }
}, },
}) })
} else{
hlsPopup.showLongCenter('比对失败')
} }
}) })
}, },
......
...@@ -4,16 +4,24 @@ ...@@ -4,16 +4,24 @@
export default { export default {
// 获取设备号 // 获取设备号
onGetRegistrationID: function (data) { onGetRegistrationID: function (data) {
let vm = this
try { try {
alert("JPushPlugin:registrationID is " + JSON.stringify(data)); alert("JPushPlugin:registrationID is " + JSON.stringify(data));
if (data.length != 0) { if (data) {
alert('111')
window.localStorage.setItem('registrationID', data) window.localStorage.setItem('registrationID', data)
} }
if (data.length == 0) { if (!data) {
window.setTimeout(this.getRegistrationID, 1000) alert('222')
window.plugins.jPushPlugin.getRegistrationID(this.onGetRegistrationID.bind(vm))
//window.setTimeout(() => this.getRegistrationID(),1000)
/* window.setTimeout(function () {
vm.getRegistrationID()
}, 1000)*/
} }
} catch (exception) { } catch (exception) {
alert('###'+JSON.stringify(exception)); alert('###'+exception);
} }
}, },
// 获取设备号 // 获取设备号
...@@ -66,7 +74,7 @@ export default { ...@@ -66,7 +74,7 @@ export default {
if (process.env.isMobilePlatform) { if (process.env.isMobilePlatform) {
window.plugins.jPushPlugin.init() window.plugins.jPushPlugin.init()
window.plugins.jPushPlugin.setDebugMode(false) 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) document.addEventListener('jpush.openNotification', this.onOpenNotification)
window.plugins.jPushPlugin.resetBadge()// 设置Badge window.plugins.jPushPlugin.resetBadge()// 设置Badge
window.plugins.jPushPlugin.setApplicationIconBadgeNumber(0) 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