Tuesday, 10 July 2018

Parse Server Push Notification to Array of Users

I am passing "message" of type String and "User" of type [String]()

Parse.Cloud.define("invite", function(request,response) {

    var message = request.params.message;
    var pushQuery = new Parse.Query(Parse.Installation);
    pushQuery.containedIn("user",request.params.User);  

    Parse.Push.send({
      where: pushQuery,
      data : { 
        alert: message,
        "badge": 1,
      }
    }, {
    success: function(result) {
    console.log(JSON.stringify(result));
    response.success(result);
    },
    error: function(error) {
    console.error(JSON.stringify(error));
    response.error(error.message)
    },
    useMasterKey: true
    });
});

I am getting the following error in the logs when trying to run this code

_PushStatus Qwd8rDJKLu: error while sending push code=107, message=bad $in value



from Parse Server Push Notification to Array of Users

No comments:

Post a Comment