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

chore(push): update gtpush

上级 88d360b0
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -12,6 +12,10 @@ declare namespace GtPush { ...@@ -12,6 +12,10 @@ declare namespace GtPush {
* 个推官网生成的appid * 个推官网生成的appid
*/ */
appid: string appid: string
/**
* 错误回调
*/
onError?: (res: {error: any}) => void
/** /**
* 个推终端ID回调,标识当前终端和应用 * 个推终端ID回调,标识当前终端和应用
*/ */
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
...@@ -17,6 +17,15 @@ if (!appid) { ...@@ -17,6 +17,15 @@ if (!appid) {
} else { } else {
GtPush.init({ GtPush.init({
appid, appid,
onError: (res) => {
console.error(res.error)
// @ts-expect-error
uni.invokePushCallback({
type: 'clientId',
cid: '',
errMsg: res.error,
})
},
onClientId: (res) => { onClientId: (res) => {
// @ts-expect-error // @ts-expect-error
uni.invokePushCallback({ uni.invokePushCallback({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册