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

fix(push): getPushClientId

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