[英]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.