Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
benmak11 opened this issue May 1, 2017 · 1 comment

Comments

@benmak11
Copy link

benmak11 commented May 1, 2017

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:

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

@morganchen12
Copy link
Contributor

Are you getting an error, or is it failing silently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants