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

fix(push): remove on push message

上级 0de1f3f0
......@@ -133,15 +133,6 @@ function initPushNotification() {
},
});
});
uni.onPushMessage((res) => {
if (res.type === 'receive' &&
res.data &&
res.data.force_notification) {
// 创建通知栏
uni.createPushMessage(res.data);
res.stopped = true;
}
});
}
}
......@@ -200,4 +191,16 @@ else {
});
},
});
// 仅在 jssdk 中监听
// #ifdef APP
uni.onPushMessage((res) => {
if (res.type === 'receive' &&
res.data &&
res.data.force_notification) {
// 创建通知栏
uni.createPushMessage(res.data);
res.stopped = true;
}
});
// #endif
}
......@@ -31,15 +31,6 @@ function initPushNotification() {
},
});
});
uni.onPushMessage((res) => {
if (res.type === 'receive' &&
res.data &&
res.data.force_notification) {
// 创建通知栏
uni.createPushMessage(res.data);
res.stopped = true;
}
});
}
}
......
......@@ -57,4 +57,19 @@ if (!appid) {
})
},
})
// 仅在 jssdk 中监听
// #ifdef APP
uni.onPushMessage((res) => {
if (
res.type === 'receive' &&
res.data &&
(res.data as any).force_notification
) {
// 创建通知栏
uni.createPushMessage(res.data)
// 阻止其他监听器继续监听
;(res as any).stopped = true
}
})
// #endif
}
......@@ -35,17 +35,5 @@ export function initPushNotification() {
})
}
)
uni.onPushMessage((res) => {
if (
res.type === 'receive' &&
res.data &&
(res.data as any).force_notification
) {
// 创建通知栏
uni.createPushMessage(res.data)
// 阻止其他监听器继续监听
;(res as any).stopped = true
}
})
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册