xugenyuan

ref |> 解决离线推送点击后,打开App且跳转对应页面问题

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -34,6 +34,7 @@ export class GetuiPush {
private lastPushContent?: PushContentBean
private initialed = false
private hasEnterMain = false
private constructor() {
}
... ... @@ -59,6 +60,10 @@ export class GetuiPush {
this.cid = cid
this.registerEvents()
this.checkSetup()
if (this.hasEnterMain) {
this.comsumeLastPushContent()
}
},
onFailed: (error:string) => {
Logger.error(TAG, "个推SDK初始化失败,error = " + error)
... ... @@ -204,11 +209,14 @@ export class GetuiPush {
if (this.initialed) {
this.comsumeLastPushContent()
} else {
this.lastPushContent = undefined
// 这里可能还没来得及初始化完成。所以不能清空
// this.lastPushContent = undefined
}
this.hasEnterMain = true
}
comsumeLastPushContent() {
Logger.debug(TAG, "尝试消费推送: " + this.lastPushContent)
if (!this.lastPushContent) {
return
}
... ...