解析云代码推送到 Android 不工作

Parse Cloud Code Push to Android Not Working

我的云代码如下所示。它可以很好地发送到 iOS,但是当发送到 Android 设备时,它不是一条消息,而是获取大量有效负载的 JS 代码。:

Parse.Cloud.define("userPraying", function(request, response) {
    var prayersObjectID = request.params.prayersObjectID;
    var whoPrayed = request.params.theirName;
      var recipientUserId = request.params.recipientId;
    var newRecipientUserId = recipientUserId.replace('User_', '');


  var pushQuery = new Parse.Query(Parse.Installation);
  pushQuery.equalTo("usersObjectId", newRecipientUserId);

    Parse.Push.send({
    where: pushQuery,
    data: {
      alert: {
      title: "Prayers Lifted!",
     body: whoPrayed + " just prayed for you.",
     "loc-args": prayersObjectID,
      },



      category : "TAGGED_CATEGORY",
 sound: "default.caf"
    }
  }).then(function() {
      response.success("Push was sent successfully.")
  }, function(error) {
      response.error("Push failed to send with error: " + error.message);
  });

});

发送给 Android 用户时,他们会获得所有 Javascript 代码,而不仅仅是消息正文。如何解决?

数据文字:

data: {
  alert: {
  title: "Prayers Lifted!",
  body: whoPrayed + " just prayed for you.",
  "loc-args": prayersObjectID,
  },



  category : "TAGGED_CATEGORY",
  sound: "default.caf"
}

从我在文档中可以看出的内容来看,它看起来无效。 https://parse.com/docs/js/guide#push-notifications-customizing-your-notifications

如果你这样做会发生什么:

data: {
  alert: "Some alert",
  title: "Prayers Lifted!",
  body: whoPrayed + " just prayed for you.",
  loc-args: prayersObjectID,
  category : "TAGGED_CATEGORY",
  sound: "default.caf"
}