Reputation: 46499
So I am currently struggling with 3 aspects related to email verification and setting it up in a way where when user clicks link in email he / she goes to app where I can then check if email was verified and show new view, aka dynamic linking?
1) I assume correct way to achieve this is by using User.sendEmailVerification(completion) ? I am struggling with setting up the completion step and would appreciate if someone could guide me through the process, also I am not 100% sure that this configures the deeplink, I might've miss-understood it.
2) If my assumption above is wrong, do I need to set up a dynamic link in firebase and then in my email templates section set it as url instead of default one i.e. myApp.firebaseapp.com/__/auth etc...
If I do it this way I can retrieve token for verifying user, do I need to perform a call in app to post it to firebase somehow once I have it?
3) If I do need to use approach no.2, is there a way to use my own domain for dynamic links? i.e. I can set up small landing page with app-associate
file for iOS and equivalent for Android, will this be enough? Do I miss out on any things like analytics here? Would you recommend for or against using custom domain for dynamic links?
Upvotes: 4
Views: 2440
Reputation: 19970
https://firebase.google.com/docs/auth/ios/passing-state-in-email-actions is the primary guide for this.
user.sendEmailVerification(withActionCodeSettings:actionCodeSettings
) - see the snippet in the doc above.Upvotes: 4