Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-07-12 18:09:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b5c1baafc313034259416d23da9c6bbab8b42477
b5c1baaf
1 parent
68f60ad2
ref |> 调整推送消息跳转处理
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
sight_harmony/features/wdHwAbility/src/main/ets/getuiPush/GetuiPush.ets
sight_harmony/features/wdHwAbility/src/main/ets/getuiPush/GetuiPush.ets
View file @
b5c1baa
...
...
@@ -52,7 +52,7 @@ export class GetuiPush {
const isOnlineEnv = HostManager.getHost() === HostEnum.HOST_PRODUCT
PushManager.initialize({
appId:isOnlineEnv ? GetuiPush.GETUI_APPID_
TEST
: GetuiPush.GETUI_APPID_TEST,
appId:isOnlineEnv ? GetuiPush.GETUI_APPID_
ONLINE
: GetuiPush.GETUI_APPID_TEST,
context: context,
onSuccess: (cid:string) => {
Logger.debug(TAG, "个推SDK初始化成功,cid = " + cid)
...
...
@@ -63,6 +63,8 @@ export class GetuiPush {
if (this.hasEnterMain) {
this.comsumeLastPushContent()
} else {
Logger.debug(TAG, "等待进入主页")
}
},
onFailed: (error:string) => {
...
...
@@ -198,21 +200,24 @@ export class GetuiPush {
if (pushContent && pushContent.isPush) {
Logger.debug(TAG, "接收到推送: " + JSON.stringify(want.parameters))
this.lastPushContent = pushContent
if (this.initialed) {
if (this.initialed
&& this.hasEnterMain
) {
this.comsumeLastPushContent()
} else {
Logger.debug(TAG, "等待初始化完成 或 进入主页")
}
}
}
// 首次进入主页,即可解析跳转推送
onReachMainPage() {
this.hasEnterMain = true
if (this.initialed) {
this.comsumeLastPushContent()
} else {
// 这里可能还没来得及初始化完成。所以不能清空
// this.lastPushContent = undefined
Logger.debug(TAG, "等待初始化完成")
}
this.hasEnterMain = true
}
comsumeLastPushContent() {
...
...
@@ -229,6 +234,9 @@ export class GetuiPush {
Logger.debug(TAG, "推送 回执: " + this.lastPushContent.want)
PushManager.setClickWant(this.lastPushContent.want)
}
} else if (this.lastPushContent.want) {
Logger.debug(TAG, "推送 回执: " + this.lastPushContent.want)
PushManager.setClickWant(this.lastPushContent.want)
}
if (this.lastPushContent.pushLink) {
Logger.debug(TAG, "跳转对应页面: " + this.lastPushContent.pushLink)
...
...
Please
register
or
login
to post a comment