plus.ts 538 字节
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3 4 5 6 7 8 9
Promise.resolve().then(() => {
  const info = plus.push.getClientInfo()
  if (info.clientid) {
    // @ts-expect-error
    uni.invokePushCallback({
      type: 'clientId',
      cid: info.clientid,
    })
  }
fxy060608's avatar
fxy060608 已提交
10 11 12 13 14 15 16
  plus.push.addEventListener('click', (result) => {
    // @ts-expect-error
    uni.invokePushCallback({
      type: 'click',
      message: result,
    })
  })
fxy060608's avatar
fxy060608 已提交
17 18 19 20 21 22 23 24
  plus.push.addEventListener('receive', (result) => {
    // @ts-expect-error
    uni.invokePushCallback({
      type: 'pushMsg',
      message: result,
    })
  })
})