华为消息推送 有透传通道吗_求解在推送用透传消息-使用厂商通道(我用的是基座测试) 用手机测试出现了“clientId离线”问题...
// #ifdef APP-PLUS
// uni.showModal({
// title: '提示',
// content: '您的用戶(hù)在其它的app登錄,如果有問(wèn)題,請(qǐng)修改密碼或重新登錄!',
// cancelText:"修改密碼",
// confirmText:"好的",
// success: function (res) {
// if (res.confirm) {
// console.log('用戶(hù)點(diǎn)擊確定');
// } else if (res.cancel) {
// console.log('用戶(hù)點(diǎn)擊取消');
// }
// }
// });
const clientInfo = plus.push.getClientInfo()
console.log(clientInfo);
console.log(clientInfo.clientid);
//clientid
const _self = this;
const _handlePush_pash= function(message) {
// 通過(guò) vuex 來(lái)同步頁(yè)面的數(shù)據(jù),僅做演示。
// 實(shí)際開(kāi)發(fā)中,這里可能是跳轉(zhuǎn)到某個(gè)頁(yè)面等操作,請(qǐng)根據(jù)自身業(yè)務(wù)需求編寫(xiě)。
console.log(message);
_self.updatePushMessage(message);
console.log(message.payload);
// uni.showModal({
// content:'duixiang1111=='+JSON.stringify(message)+"duixiang111",
// showCancel: false
// });
var message_payload = JSON.parse(message.payload);
// uni.showModal({
// content:'duixiang=='+JSON.stringify(message_payload)+"duixiang",
// showCancel: false
// });
console.log(message_payload);
// var message_payload = JSON.stringify(payload);
//將對(duì)象轉(zhuǎn)為字符串 JSON.stringify(jsObj)
//JSON字符串轉(zhuǎn)為對(duì)象 JSON.parse(str);
console.log(message_payload.titelok);
console.log(message_payload.pagePath);
// uni.showModal({
// content:'tiaozhuang=='+message_payload.pagePath+"tiaozhuang",
// showCancel: false
// });
//這個(gè)很重要 因?yàn)榧虞d要時(shí)間 定時(shí)器的重要性
setTimeout(() => {
//這個(gè) 調(diào)整
uni.navigateTo({
url: message_payload.pagePath
});
},1000);
//end 定時(shí)器 他有緩沖時(shí)間
};
plus.push.addEventListener('click', function(message) {
plus.nativeUI.toast('111push click');
console.log(message);
var message_payloadxxx = JSON.parse(message.payload);
//return;
_handlePush_pash(message);
});
plus.push.addEventListener('receive', function(message) {
plus.nativeUI.toast('push receive');
console.log(message);
// var i=0;
var jsonData = JSON.stringify(message.payload) //字字符串 對(duì)項(xiàng)專(zhuān)字符串
var jsonData1 = JSON.stringify(message) //字字符串 對(duì)項(xiàng)專(zhuān)字符串
//var jsonData=JSON.parse(message.payload) //字字符串 對(duì)項(xiàng)專(zhuān)字符串
//蘋(píng)果解決
if (message.type == 'receive') {
//plus.push.createMessage(message.content,message.payload,message.title);
// plus.push.createMessage(message.content,jsonData,message.title);
// plus.push.createMessage(message.content,jsonData,message.title);
// plus.push.createMessage(message.content,aaa);
plus.push.createMessage(message.title, jsonData); //可以到頁(yè)面
}
// return;
//_handlePush(message);
});
// #endif
總結(jié)
以上是生活随笔為你收集整理的华为消息推送 有透传通道吗_求解在推送用透传消息-使用厂商通道(我用的是基座测试) 用手机测试出现了“clientId离线”问题...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: python 多线程并发_寻找pytho
- 下一篇: HCIA-RS(211-中文题库,201