javascript - How can I send a Parse Push notification only to installations that are subscribed to two channels, not either/or? -
i know according documentation, if wanted send push notification installations in "giants" , "mets" channels, so:
parse.push.send({ channels: [ "giants", "mets" ], data: { alert: "the giants won against mets 2-3." } }, { success: function() { // push successful }, error: function(error) { // handle error } }); what want however, send push notification installations in both channels, not 1 of them only.
so going off example above, rather sending installation in "giants" or "mets" channels, send installations in both @ same time, not ones have "giants" or "mets". there way this?
the alternative sending channels based push, push-to-query. construct parse.query matching installations want, , send way.
because of this, can use 'containsall' constraint on channel key. give shot.
var query = new parse.query(parse.installation); query.containsall("channels", ["giants", "mets"]); parse.push.send({ where: query, data: { alert: "the mets won!" } }).then(function() { // success }, function(error) { // error });
Comments
Post a Comment