Created
August 4, 2018 11:01
-
-
Save atanasovdejan/592a42b89e7f090e23c7201a341532b0 to your computer and use it in GitHub Desktop.
Profile Change Request in Firebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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