So I am working closely with mobile dev team to generate the proper email when the user signs up, resets the pw etc.
With this piece of code that I pasted below and after all the whitelisting & dynamic link config, we are finally generating the link. It works fine with both apps, iOS and Android. The problem comes with the webapp. If an user tries to register through the app and receives this email but opens it at desktop, the webapp will show a 404 and won't go to the url that I set in url: baseUrl
(which is the url the user would be able to activate his email).
What am I not understanding here?
exports = module.exports = region('europe-west1').https.onRequest(async (
request,
response,
): Promise<any> => {
const CONFIG = config();
const { mobile } = CONFIG;
const baseUrl = CONFIG.bloqify.base_url;
const actionCodeSettings: authLib.ActionCodeSettings = {
url: baseUrl,
iOS: {
bundleId: mobile.ios.bundle_id,
},
android: {
packageName: mobile.android.package_name,
installApp: true,
minimumVersion: mobile.android.moinimum_version,
},
handleCodeInApp: true,
dynamicLinkDomain: mobile.dynamic_link.domain,
};
const [generateLinkError, generateLinkSuccess] = await to(
auth.generateEmailVerificationLink('testemail@test.com', actionCodeSettings),
);
if (generateLinkError) {
console.log(generateLinkError.message);
return response.status(500).send({
success: false,
refunded: !!generateLinkError,
message: generateLinkError.message,
});
}
console.log(generateLinkSuccess);
return response.status(200).send({ success: true });
});