0

Right now, I can login through Google with my app. I can post a marker on a map that will save the lat and longitude of my marker (using GeoFire) and I can also store user information into my DB (with Firebase).

But if I attempt to use the app and login from a separate account and post a marker, the first initial marker and user information will be replaced by the 2nd account.

What can I do so that a unique user can't replace another user's marker or info?

This is the code that will run when a user taps a button:

                    mDatabase.child("User").child("userName").setValue(profile.getName());
                    mDatabase.child("User").child("userID").setValue(profile.getUserId());

                    geoFire.setLocation("markerLocation", myLocation);
SaltySea
  • 700
  • 1
  • 7
  • 21
  • can you post your database structure? and how many marker can each user post? – Wilik Aug 20 '16 at 08:18
  • read here https://stackoverflow.com/questions/38340949/how-to-save-geofire-coordinates-along-with-other-items-in-firebase-database – Wilik Aug 20 '16 at 08:31
  • @Wilik Right now, a user can only post 1 because it just keeps replacing the same data values. So if I post a marker in New York as User A and post a marker again in Toronto as the same user, the marker gets replaced. – SaltySea Aug 20 '16 at 13:30
  • @Wilik It seems I have to be using .push(), I'll give that a shot and see where it goes from there. – SaltySea Aug 20 '16 at 13:31

0 Answers0