Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. func firebaseSignInWithLink(credential: FIRAuthCredential) {
  2.  
  3. FIRAuth.auth()?.signIn(with: credential, completion: { (user, error) in
  4. if error != nil {
  5. debugPrint("APP: there has been an error signing into firebase, perhaps another account with same email")
  6. debugPrint("APP: (error)")
  7.  
  8. // if existing email, try linking
  9. FIRAuth.auth()?.currentUser?.link(with: credential, completion: { (user, error) in
  10. if error != nil {
  11. debugPrint("APP: there has been an error signing into firebase")
  12. debugPrint("APP: (error)")
  13. }
  14. else {
  15. debugPrint("APP: successfully signed into firebase")
  16. }
  17. })
  18. }
  19. else {
  20. debugPrint("APP: successfully signed into firebase")
  21. }
  22. })
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement