I incorporated Firebase's email verification for my iOS mobile app and am trying to resolve the following issues:
- The length of the redirect url appears extremely long. It looks like it repeats itself.
- When I set
handleCodeInAppequal to true, and am redirected back to the app when I click on the redirect url, the user's email is not verified. Whereas when I set it to false and go throughFirebase'sprovided web widget, it does get verified. Wasn't able to find documentation that outlined handling the former in swift...
Any thoughts are appreciated.
func sendActivationEmail(_ user: User) {
let actionCodeSettings = ActionCodeSettings.init()
let redirectUrl = String(format: "https://www.app.com/?verifyemail=%@", user.email!)
actionCodeSettings.handleCodeInApp = true
actionCodeSettings.url = URL(string: redirectUrl)
actionCodeSettings.setIOSBundleID("com.app.app")
Auth.auth().currentUser?.sendEmailVerification(with: actionCodeSettings) { error in
guard error == nil else {
AlertController.showAlert(self, title: "Send Error", message: error!.localizedDescription)
return
}
}
}
iflquery parameter in case the app is not installed. - bojeil