firebase / firebase/geofire-objc
geoFire setLocation method does not save location to Firebase Database - Swift 3
- Dominant language
- Objective-C
- Stars
- 447
- Forks
- 183
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am working in Xcode 8.3.2 with the latest swift release (Swift 3). I have been using the setLocation method for saving my current location in my firebase database. Is there something wrong with this code block:
```swift
func updateUserLocation() {
let userID = FIRAuth.auth()!.currentUser!.uid
print("BEN --- Current user ID: \(userID)")
geoFire!.setLocation(currentLocation, forKey: userID){ (error) in
if(error != nil){
print("BEN: --- An error occured: \(String(describing: error))")
} else {
print("Ben ---- Saved location")
}
}
}
```
Or am I missing something? Your help would be greatly appreciated.
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.