Michel
Michel

Reputation: 11753

How to find the display name of a user in Firebase?

When using Firebase in an iOS app (Swift 3) what is the way to get the displayname of a user knowing her/his uid?

I know how to find the displayname of the current user. But I want it for any user.

Upvotes: 0

Views: 1263

Answers (1)

kunalkamble
kunalkamble

Reputation: 294

if you are trying to look inside default auth record then it is only accessible for that user, if you want to access data for all users then in signup process you need to create users node and store readable data there so that is all the time accessible.

users
  $uid1
     metadata
        name: 'John Doe'
        avatar: 'image-url.jpg'
  $uid3
     metadata
        name: 'Rick Ross'
        avatar: 'image-url.jpg'

you can define rule for user metadata, and can make it public and can be access any time.

Upvotes: 1

Related Questions