I realized that the updatelistener does not get invoked when I merely add a new relation. How can I get notified when things like this occur?
For example a user decides to follow another user, so in the “following” array of the current User object I append the new User but I also want it to get saved in the server and notified.
Is it possible this way?
I’m on iOS.
Thanks.
Hi Gabor
Unfortunately, updateListener doesn’t listen relations changes.
But I guess I can propose you a workaround:
- add a new EventHandler in BL “afterAddRelation”
- in the event handler code you can send a push notification to related user
- mobile device receives the push notification and display some alert or do something else
Regards, Vlad
Thanks Vlad, that is really a possible solution.
What I’m working on is trying to refactor the relations into intermediary tables so those changes in the relations are represented by an update/save action. These’ll be caught by listeners.
1 Like