提交 feaa4d1f 编写于 作者: fxy060608's avatar fxy060608

fix(push): getPushClientId

上级 bc4c5cf5
......@@ -81,7 +81,7 @@ export function getPushClientId (args) {
(info) => {
const res = {
errMsg: 'getPushClientId:ok',
cid
cid: info.clientid
}
hasSuccess && success(res)
hasComplete && complete(res)
......@@ -131,22 +131,22 @@ let listening = false
export const onPushMessage = (fn) => {
if (onPushMessageCallbacks.indexOf(fn) === -1) {
onPushMessageCallbacks.push(fn)
}
// 不能程序启动时就监听,因为离线事件,仅触发一次,框架监听后,无法转发给还没开始监听的开发者
if (__PLATFORM__ === 'app' && !listening) {
listening = true
plus.push.addEventListener('click', (result) => {
invokePushCallback({
type: 'click',
message: result
})
})
plus.push.addEventListener('receive', (result) => {
invokePushCallback({
type: 'pushMsg',
message: result
})
})
}
// 不能程序启动时就监听,因为离线事件,仅触发一次,框架监听后,无法转发给还没开始监听的开发者
if (__PLATFORM__ === 'app' && !listening) {
listening = true
plus.push.addEventListener('click', (result) => {
invokePushCallback({
type: 'click',
message: result
})
})
plus.push.addEventListener('receive', (result) => {
invokePushCallback({
type: 'pushMsg',
message: result
})
})
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册