imperiumlabs / GeoFirestore-Android

GeoFirestore for Android - Realtime location queries with Firestore
MIT License
123 stars 36 forks source link

Location doesn't exist #46

Open champrocks3190 opened 4 years ago

champrocks3190 commented 4 years ago

im getting error im using java code , i can write successfully but can not get location from same key .

geoFirestore.setLocation("hi", new GeoPoint(37.7853889, -122.4056973), new GeoFirestore.CompletionCallback() { @Override public void onComplete(@Nullable Exception e) { if (e == null) { Log.d("SUCCESS", "Location saved on server successfully!"); } else Log.e("FAIL", "no write " + e.getMessage());

            }
        });

        geoFirestore.getLocation("hi", new GeoFirestore.LocationCallback() {
            @Override
            public void onComplete(GeoPoint location, Exception exception) {
                if (exception == null && location != null) {
                    Log.e("LOC", "" + String.format("The location for this document is [%f,%f]", location.getLatitude(), location.getLongitude()));
                }else
                    Log.e("FAIL", "no write     " + exception.getMessage());
            }
        });