Firebase Hosting pass variables in url - firebase

I'm building an app in Flutter mainly based on IOS and Android. We have a review system, and for new signups we want to collect referalls from past customers.
We will accomplsih it like this:
Send API POST email to the referrers,
Attached to the email is a URL to our website, we want an ID attached to it.
The thing I want to fix is with the URL. For us to be able to know who the person being reviewed is on the web, I would like to pass the URL like this:
https://example.com/{id}
I am unsure how to do this via Firebase Hosting, which is where we host the site.
How can we accomplish passing the ID in the URL?
My Hosting Config looks like this:
"hosting": {
"public": "build/web",
"source": "**",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
Would be really thankful for an explanation!
Thanks

Related

Is it possible to change url displayed in address bar for my firebase web?

I bought a domain called xxx.net from godaddy.
When I type this address in browser, it gives the firebase page.
However, the url displayed in the address bar automatically changes to xxx.firebaseapp.com .
I want to change the url displayed to be xxx.net.
How can I do it?
Thank you!
Here is my firebase json.
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
It sounds like you've set up a redirect from your custom domain at GoDaddy to the default domain that Firebase created for you.
If you follow the Firebase instructions on connecting a custom domain, you will add A records to your DNS (at GoDaddy), which serve the exact same content as you currently see, but then directly when you type in your own domain name, instead of with a redirection.
If you're having a hard time making this work, edit your question to show how you've set up your DNS zone at GoDaddy, and how you configured the domain in the Firebase Hosting console. The firebase.json file has no setting that are relevant to the custom domain.

set up custom route for dynamic link, without using firebase hosing

According to the firebase official documentation, to set up a custom route like /link in your custom domain like example.com, I need to use firebase hosting already and do the following configuration there:
"hosting": {
// ...
"appAssociation": "AUTO",
"rewrites": [
{
"source": "/link/**",
"dynamicLinks": true
},
]
}
But I'm not using firebase hosting, and Obviously, I don't have such a configuration.
So I can have the same result with no firebase hosting?
This has worked for me in the past with custom domain names for dynamic links: when you get the error in the dynamic links page, open the Authentication(you don't actually need to use firebase authentication on this project for this to work), go to sign in method, enable Email/Password then scroll down to Authorized Domains and add your domain as an authorized domain. This won't affect your current website or email. Go back to hosting and try to set up the URL prefix again.

How deploy two app on the same domain firebase? [duplicate]

I have purchased a domain ("www.mydomain.com"). How do I make a subdomain on Firebase ("sub.mydomain.com"), if I am using Firebase hosting?
Update
You can now add multiple domains to a single Firebase Hosting site. Domains can either serve site content or redirect to another domain (editable at any time). In addition, you can now use subdomains of the same registered domain on different projects, such as example.com on one project and blog.example.com on another. Visit your hosting admin page to configure them.
Original answer
If you point multiple subdomains of mydomain.com to Firebase Hosting, it will redirect others to the one you chose when specifying your custom domain. If you're looking to simply serve content from one subdomain, all you need do is specify that one in the custom domain field on you Hosting tab and point your DNS for that subdomain to Firebase Hosting, following the instructions provided.
If, however, you're looking to serve different content on different subdomains, that's not currently possible, though this is a highly requested feature that we're considering implementing
i believe you can use rewritte rules on the hosting configuration json file
since all domains and subdomains you point to your firebase project will be redirected to your single firebase hosting bucket, youll need to set up custom rewrite rules for each domain you want to separate, to redirect them to an specific folder or cloud function in your project.
i suggest to check the next url as reading material, its a new techinque to work with projects in firebase
https://github.com/jthegedus/firebase-functions-next-example
on your firebase.json file
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "/.well-known/assetlinks.json",
"destination": "/instant/assetlinks.json"
},
{
"source": "sub.domain.com/**",
"destination": "/subdomain/**"
}
]
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}

I want to set firebase two subdomain [duplicate]

I have purchased a domain ("www.mydomain.com"). How do I make a subdomain on Firebase ("sub.mydomain.com"), if I am using Firebase hosting?
Update
You can now add multiple domains to a single Firebase Hosting site. Domains can either serve site content or redirect to another domain (editable at any time). In addition, you can now use subdomains of the same registered domain on different projects, such as example.com on one project and blog.example.com on another. Visit your hosting admin page to configure them.
Original answer
If you point multiple subdomains of mydomain.com to Firebase Hosting, it will redirect others to the one you chose when specifying your custom domain. If you're looking to simply serve content from one subdomain, all you need do is specify that one in the custom domain field on you Hosting tab and point your DNS for that subdomain to Firebase Hosting, following the instructions provided.
If, however, you're looking to serve different content on different subdomains, that's not currently possible, though this is a highly requested feature that we're considering implementing
i believe you can use rewritte rules on the hosting configuration json file
since all domains and subdomains you point to your firebase project will be redirected to your single firebase hosting bucket, youll need to set up custom rewrite rules for each domain you want to separate, to redirect them to an specific folder or cloud function in your project.
i suggest to check the next url as reading material, its a new techinque to work with projects in firebase
https://github.com/jthegedus/firebase-functions-next-example
on your firebase.json file
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "/.well-known/assetlinks.json",
"destination": "/instant/assetlinks.json"
},
{
"source": "sub.domain.com/**",
"destination": "/subdomain/**"
}
]
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}

Multiple apps pointing to different subdomains on Firebase [duplicate]

I have purchased a domain ("www.mydomain.com"). How do I make a subdomain on Firebase ("sub.mydomain.com"), if I am using Firebase hosting?
Update
You can now add multiple domains to a single Firebase Hosting site. Domains can either serve site content or redirect to another domain (editable at any time). In addition, you can now use subdomains of the same registered domain on different projects, such as example.com on one project and blog.example.com on another. Visit your hosting admin page to configure them.
Original answer
If you point multiple subdomains of mydomain.com to Firebase Hosting, it will redirect others to the one you chose when specifying your custom domain. If you're looking to simply serve content from one subdomain, all you need do is specify that one in the custom domain field on you Hosting tab and point your DNS for that subdomain to Firebase Hosting, following the instructions provided.
If, however, you're looking to serve different content on different subdomains, that's not currently possible, though this is a highly requested feature that we're considering implementing
i believe you can use rewritte rules on the hosting configuration json file
since all domains and subdomains you point to your firebase project will be redirected to your single firebase hosting bucket, youll need to set up custom rewrite rules for each domain you want to separate, to redirect them to an specific folder or cloud function in your project.
i suggest to check the next url as reading material, its a new techinque to work with projects in firebase
https://github.com/jthegedus/firebase-functions-next-example
on your firebase.json file
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "/.well-known/assetlinks.json",
"destination": "/instant/assetlinks.json"
},
{
"source": "sub.domain.com/**",
"destination": "/subdomain/**"
}
]
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
}

Resources