2

Is it possible to get subscription alerts for live queries on a single client instead of everyone. I am using the following code to get update alerts for the object 'obj' on class 'class-name'. But the alert message comes on every client( i.e every instance of running app).

let query_add = new Parse.Query("class-name");
let subscription = query_add.subscribe();

subscription.on('update', (obj) => {
   alert('object updated');
});

How can I modify this to notify only the single client.

sap
  • 234
  • 5
  • 16
  • If I'm understanding the question correctly, this seems like a problem unrelated to parse. Generically stated, how can I run client-specific code of the form `if (I_AM_THE_SPECIAL_CLIENT) { // do something } `. Web clients don't really have a way to ask this. Having a particular user identity is a decent approximation, the only one I can think of. – danh Jul 20 '18 at 05:05
  • Oh maybe! I just figured out that one has to give session token as argument in subscribe call. It works after that! Thanks! – sap Jul 20 '18 at 06:51

0 Answers0