提交 cfdb3401 编写于 作者: H hulinNeil

修改push示例发送的透传消息格式

上级 db73cb94
......@@ -80,7 +80,8 @@
uni.showToast({
title: "接收到透传数据"
});
this.tranMsg = e.data;
this.tranMsg = JSON.stringify(e.data);
}
})
},
......@@ -105,7 +106,11 @@
}
url += ('&title=' + encodeURIComponent('Hello uniapp'));
url += ('&content=' + encodeURIComponent('带透传数据推送通知!'));
url += ('&payload=' + encodeURIComponent('\'{"title":"Hello uniapp Test","content":"test content","payload":"1234567890"}\''));
if(plus.os.name === 'iOS'){
url += ('&payload=' + encodeURIComponent('{"title":"Hello uniapp Test","content":"test content"}'));
}else{
url += ('&payload=' + encodeURIComponent('\'{"title":"Hello uniapp Test","content":"test content"}\''));
}
url += ('&version=' + encodeURIComponent(plus.runtime.version));
plus.runtime.openURL(url);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册