Answers for "firestore geopoint query example in android"

0

firestore geopoint query example in android

QueryLocation queryLocation = QueryLocation.fromDegrees(latitude, longitude);
Distance searchDistance = new Distance(1.0, DistanceUnit.KILOMETERS);
geoFire.query()
    .whereEqualTo("title", "The Title")
    .whereNearTo(queryLocation, distance)
    .orderBy("timestamp", Query.Direction.DESCENDING)
    .limit(10)
    .build()
    .get()
    .addOnCompleteListener(task -> {
      if (task.isSuccessful()) {
        Log.i("DB", "Got Documents.");
      } else {
        Log.w("DB", "Error getting documents.", task.getException());
      }
    });
Posted by: Guest on November-06-2020

Browse Popular Code Answers by Language