If I have 2 users, is it possible for user1 to send user2 a push notification if user2's app is in the background?
The scenario is: user1 updates a field in a Firestore document. At this point, I want user1 to send a push notification to user2 notifying them of the change.
At the moment, user2 can successfully detect document changes when the app is in the foreground via document.addSnapshotListener()
.
However when user2 leaves the app their snapshotListener
is removed.
Is there a way I can send a push notification from user1 to user2 while only using Firestore and built-in Android APIs or Firebase Cloud Messaging? Or do I have to use something like Google Cloud Functions for this to work?