Firebase messaging: subscribed topics with Location Triggered Notifications

485 views Asked by At

I'm using firebase cloud messaging and its notification mechanism I've the following scenario, can you please help? My android application allows its users to subscribe to interests (like running,movies,RESTAURANT): by using Firebase messaging topics mechanism

If any user creates a RESTAURANT event for example, I want that only nearby users within a radius (example 10km) receive a notification that a RESTAURANT event has been created.

The problem is that Firebase topics don't allow a filtering on locations. It send the notification to any user subsribed to RESTAURANT topics. Segments logic didn't allow the subscription mechanism I've spend long days and hours on the topic: geofence and geofire aren't the direct solution or may be I did misunderstood.

I'd explored geospark but it's very expensive. Any idea how to solve this . thank you?

1

There are 1 answers

1
Frank van Puffelen On

There is nothing built into Firebase Cloud Messaging to geo-target users. You will have to either use a third-party solution that builds this functionality on top of FCM, or you will have to build your own solution.

A good starting point for building your own would be to have a look at GeoFire, a library that adds geo-querying capabilities on top of Firebase's Realtime Database.

For more info see: