I am sending an email verification link through my app, and ideally I want the link to open on my app.
My very first step is to test IF the link actually works. So I am generating the custom verification link, send it to my email, and I want to test it if it works on browsers.
This is my code to generate the link:
export async function sendVerificationEmail() {
const auth = getAuth();
const userEmail = firebase.auth().currentUser.email;
console.log("send CUSTOM email verification: ", userEmail);
var actionCodeSettings = {
url: ";,
iOS: {
bundleId: 'com.mycompany.myapp'
},
android: {
packageName: 'com.mycompany.myapp',
installApp: true,
minimumVersion: '1'
},
handleCodeInApp: true,
// When multiple custom dynamic link domains are defined, specify which
// one to use.
dynamicLinkDomain: "myapp.page.link"
};
firebase.auth().currentUser.sendEmailVerification(actionCodeSettings)
.then(function() {
console.log("email verification was sent")
})
.catch(function(error) {
console.log("error while sending email: ", error);
});
}
If I am generating the url wrongly, please let me know.
The generated url is the following: ://myfirebaseproject.firebaseapp/__/auth/action?apiKey%somekeyQ%26mode%3DverifyEmail%26oobCode%someCode%26continueUrl%3D;apn=com.mycompany.myappname&amv&ibi=com.mycompany.myappname&ifl=://myapp/verifyEmail%26lang%3Den
When I click on the above link the error which I see is "Invalid Dynamic Link - Blocked".
This is strange for me, because I have whitelisted the url, I dont understand why it is blocked. My allowlist patterns:
^/.*$
^/.*$
^myapp.page.link/.*$
Can you give me some hints, because its been over a month since I am trying to make this work.