This is the setLocation function (copypaste) from GeoFirestore.kt
fun setLocation(documentID: String?, location: GeoPoint, completionCallback: CompletionCallback?) {
if (documentID == null) {
completionCallback?.onComplete(NullPointerException("Document ID is null"))
return
}
//Get the DocumentReference for this documentID
val docRef = this.getRefForDocumentID(documentID)
val geoHash = GeoHash(GeoLocation(location.latitude, location.longitude))
//Create a Map with the fields to add
val updates = HashMap<String, Any>()
updates["g"] = geoHash.geoHashString
updates["l"] = location
//Update the DocumentReference with the location data
docRef.set(updates, SetOptions.merge())
.addOnSuccessListener { completionCallback?.onComplete(null) }
.addOnFailureListener { completionCallback?.onComplete(it) }
}
This is the
setLocation
function (copypaste) from GeoFirestore.ktAs you can see on the last lines:
This should return
null
if the function is completed successfully, therefore, in theREADME
appears the following (screenshot below):This is wrong, as if it was successfully,
exception
will benull
. It should be the other way around.Do you accept Pull requests?