0

Im using parse.com and I wonder if there is a possible approach to get notified when PFObject on parse change one of his properties. The only sollution that I see is to use Push notifications and when notification arrive a refresh the object. Is this the bes possible way or there is a better one?

Thanks.

Klemen
  • 2,144
  • 2
  • 23
  • 31

2 Answers2

0

I don't think there is a way to do this. As you suggested I would simply refresh the PFObject before using it

Dhwanit Zaveri
  • 465
  • 1
  • 5
  • 15
0

You could create cloud-code .beforeSave / .afterSave function, which will trigger notification to be send. However it could be very wasteful, so perhaps depending on your timing needs you may also query for objects with recent updatedAt dates every once in a while ?

Parse.Cloud.beforeSave("className", function(request, response) {
if (request.object.existed() ) { //this is update of already existing object //... check if change has been done and trigger new notification } });

PetrV
  • 1,368
  • 2
  • 15
  • 30