4

I need a way to search for people nearby and send them a push notification. Doesn't seem like I can use topics for this, so probably need a way to query for users?

Zorayr
  • 23,770
  • 8
  • 136
  • 129
user39587
  • 301
  • 3
  • 13
  • What you're asking for is known as a geoquery. The common way to do this is by using a GeoFire library, such as this one https://pub.dev/packages/geo_firestore – Frank van Puffelen Nov 05 '19 at 05:36

1 Answers1

7
  1. save users locations in firestore (using geolocator plugin)

  2. get current user location (using geolocator plugin)

  3. Calculate the distance between the user and other users (using geolocator plugin)

    Geolocator().distanceBetween();
    
  4. Put a condition as example if(distance < 200) show users

  5. send a notification to the selected user (Firebase Cloud Messaging)

Sorry I couldn't give more details because they are many questions.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
SUX
  • 850
  • 8
  • 21