Skip to content

Instantly share code, notes, and snippets.

@atanasovdejan
Created August 4, 2018 11:01
Show Gist options
  • Save atanasovdejan/592a42b89e7f090e23c7201a341532b0 to your computer and use it in GitHub Desktop.
Save atanasovdejan/592a42b89e7f090e23c7201a341532b0 to your computer and use it in GitHub Desktop.
Profile Change Request in Firebase
func createProfileChangeRequest(photoUrl: URL? = nil, name: String? = nil, _ callback: ((Error?) -> ())? = nil){
if let request = Auth.auth().currentUser?.createProfileChangeRequest(){
if let name = name{
request.displayName = name
}
if let url = photoUrl{
request.photoURL = url
}
request.commitChanges(completion: { (error) in
callback?(error)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment