Reputation: 2147
I have integrated firebase authentication with email in my android app. I have two domain url prefix in dynamic links section. By default, firebase always sends link with first domain url prefix. I tried setting domain url prefix in code by this method -
actionCodeSettings.setDynamicLinkDomain(getString(R.string.dynamic_link_url))
but it gives error of The provided dynamic link domain is not configured or authorized for the current project Please advice correct way of acheiving this. Thanks in advance.
Upvotes: 6
Views: 1479
Reputation: 7935
I'd doing basically the same as in the question, but just in Flutter setting the dynamicLinkDomain
property in the ActionCodeSettings
using the EmailLinkProvider
eg.
dynamicLinkDomain: 'mysuperapp.page.link',
and it seems to work fine.
I did NOT have to do anything with Firebase CLI updating the hosting history as was suggested in the answer from @fadi-abo-msalam
Given that Flutter would be using the same underlying Android Firebase SDK, perhaps this has been fixed since this question was first asked and it now works for native Android apps as well.
Upvotes: 1
Reputation: 7197
if you added a new URL prefix different from the first one you need to manually update Firebase hosting release history
you can do it by using firebase CLI
make sure firebase cli is installed
firebase login and select your project
run firebase init make sure during project initialization, from the Firebase CLI prompts:to select to set up Hosting and Functions Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
continue with the default option
once setup is completed it will generate public folder contained index.html 404.html, .firebaserc and firebase.json
then modify the firebase.json and add the following
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"appAssociation": "AUTO",
"rewrites": [ { "source": "/links/**", "dynamicLinks": true }, { "source": "/share/**", "dynamicLinks": true } ]
}
}
enter code here
please note that links and share are our 2 prefix you can change name to any you want and also note this prefix can be used by different subdomains as well
Upvotes: 1