firebase / firebase/geofire-objc

geoFire setLocation method does not save location to Firebase Database - Swift 3

Open
#81 1 comment 3 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.