I'm trying to retrieve the FirebaseUser provider's data, but Swift debugger is returning the error
Cannot call value of non-function type '[UserInfo]'
as can be seen in my code in the picture below:
let providData = userInstance.providerData {
for profile in providerData {
if profile.providerID == "facebook.com" {
let fbUserId = profile.uid
fbProfilePicUrl = "https://graph.facebook.com/\(fbUserId)/picture?height=300"
self.profilePicUrl = fbProfilePicUrl
}else if profile.providerID == "google.com" {
let googleUserId = profile.uid
//self.profilePicUrl = .....
}
}
}
Can someone tell me what's wrong?
providerData
is an array property of FIRUser
check Here , that you can't use { after it , so you need
for profile in user.providerData {
if profile.providerID == "facebook.com" {
let fbUserId = profile.uid
fbProfilePicUrl = "https://graph.facebook.com/\(fbUserId)/picture?height=300"
self.profilePicUrl = fbProfilePicUrl
}else if profile.providerID == "google.com" {
let googleUserId = profile.uid
//self.profilePicUrl = .....
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.