get user name from firebase

Hello all,
Trying to get a user name from firebase and then displayed on a label.
Any help?
heres a sample of the code.
Thanks in advance

Code Block import UIKit
import Firebase
class HomeViewController: UIViewController {
   
   
  @IBOutlet weak var userName: UILabel!
   
   
   
  override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
                    
      }
   
  func getUserName(_ message:String) {
    let uid = Auth.auth().currentUser?.uid
    Database.database().reference().child("users").child(uid!).observeSingleEvent(of: .value, with: { (snapshot) in
       
      if let dictionary = snapshot.value as? [String: AnyObject] {
        self.userName.text = dictionary["firstname"] as? String
         
      }
       
    })
    }
  }


Firebase is not a framework of Apple's. You will get better responses sooner if you post such questions in a proper site, such as supporting site or community sites of Firebase.
get user name from firebase
 
 
Q