![](/img/trans.png)
[英]Is it possible to send additional data with parse push notifications using cloud?
[英]Parse push notifications send data
我正在嘗試通過解析推送通知在有效負載中發送數據。
Parse.Push.send({
where: pushQuery, // for sending to a specific channel
data: payload,
}, { success: function() {
console.log("#### PUSH OK");
}, error: function(error) {
console.log("#### PUSH ERROR" + error.message);
}, useMasterKey: true});
response.success('success');
});
在我的有效負載中,我存儲了customData字段。 如何在自定義廣播接收器的onReceive()中訪問此字段;
如果您的結果是捆綁銷售商品,則可能應該在Android App中使用它
/**
* Called when message is received.
* @param from SenderID of the sender.
* @param data Data bundle containing message data as key/value pairs.
* For Set of keys use data.keySet().
*/
override fun onMessageReceived(from: String?, data: Bundle?) {
if (data != null) {
val message = data.getString("text")
val title = data.getString("title")
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.