upload .well-known/assetlinks.json to Firebase Hosting on Mac - firebase-hosting

I am setting up a Firebase Dynamic Links using App Links for a website that is also hosted in Firebase Hosting. I need to upload a .well-known/assetlinks.json to my Firebase Hosting website.
I am working on Mac, and if I try to create the .well-known folder on my Mac's drive it says:
This makes it for me impossible to create, and then of course also upload the assetlinks.json (using the Firebase CLI which is the only tool that allows you to publish files to Firebase Hosting).
How can I install the required .well-known/assetlinks.json on my Firebase Hosting?

I found the following work-around:
(1) Create a well-known/assetlinks.json locally => notice its without the . at the beginning which made it impossible on my Mac to create this folder originally
(2) Update the firebase.json file to add a rewrite rule :
"rewrites": [
...
{
"source": "/.well-known/assetlinks.json",
"destination": "/well-known/assetlinks.json"
},
...
],
(3) Publish to firebase hosting
Its not an ideal solution, but it works...

Related

Requests within ServerSideProps not working on Firebase Hosting with NextJS

My objective is to host my NextJS PWA on Firebase Hosting. Everything is working fine in development and even on production with Vercel but it doesn't work on Firebase Hosting. In ServerSideProps, I am trying to request data from the FireStore or from a third party(Nordigen).
All ServerSideProps are in the pages folder (Example of the codes of a ServerSideProps) . Not sure if it matters but some functions definition such as tokenhandler (see code above) are in another folder called utils (files path).
I have followed most guides on the web on how to deploy an nextjs app on Firebase Hosting.
From what I understood, those are the most important files for deploy NextJs on Firebase Hosting :
firebase.json
firebase.serc
server.js
next.config.js
Currently, everything is rendered from client side on Firebase Hosting but nothing from serversideprops side.
Does someone have an idea?

How to save Flutter web file_picker selections to host directory

There are numerous examples online for using file_picker and uploading to Firestore, SQL etc; but it appears there are none for uploading right to the webhost directory where index.html is being served (i.e ./uploads).
As I am using flutter web in a corporate environment my options for spinning up remote storage options are nearly nil. I merely want my flutter web app to allow users to upload to our own environment (I host my web build off Sharepoint and it works perfect).
The solution for posting to web found here (https://stackoverflow.com/a/65759028/82856) is very close to what I need except for the http.MultipartRequest part as I don't have a server API listening for POST requests. What other options do I have for merely writing uploads to a directory like ./upload? Thanks in advance.

Using Firebase's reserved hosted URLs for local flutter development

I'm developing an app in flutter and deploying it to Firebase hosting.
Firebase hosting and the firebase serve command for local development let you initialize Firebase from a special auto-generated relative URL (/__/firebase/init.js).
This is nice because it allows me to share my project (on github, for example) without including my Firebase configuration.
Sadly, this does not seem to play nice with flutter run -- if I use flutter run, I lose the special URLs, and if I use firebase serve, I lose flutter's hot reload features.
My current workaround is to have the following local files under my app/web/ directory:
__/firebase/init.js # containing firebase.initializeApp(myFirebaseConfig);
__/firebase/7.1.44/firebase-app.js # manually downloaded from the gstatic cdn
__/firebase/7.1.44/firebase-auth.js
# ... (etc)
This works, but:
The __ directory actually gets deployed to Firebase. (Not actually a problem, but it seems wrong)
It's annoying to set this up manually in each local development environment.
Ideally, one should be able to firebase login, firebase init, and then flutter serve, and then automagically have access to the /__/ directory.
Is there already some way to make this happen, and if not, how could we implement it?
(For example, is there a way to extend flutter's local http server to take advantage of the logic that's already in the firebase-tools npm module?)

What files to package Atlassian Connect Express Confluence Macro

I am trying to find what files to upload and where for my web confluence plugin. I know the atlassian-connect.json needs to be uploaded to an https:// location. Do I upload that project root direct in the same location as well as all the folders, or can I skip uploading the node_modules folder?
You need to host the whole app on a hosting platform that you choose, and yes that includes the atlassian-connect.json file. Once you upload it and have it running you can install it into your Confluence app using the url to your atlassian-connect.json file.
If you haven't already, you should go through the Getting Started guide on the docs. This will walk you through setting up an app and getting it running locally and installing a running app into Confluence.

Firebase Storage Can't Connect, Retry again

I imported an old project into Firebase when I joined.
On the https://console.firebase.google.com/project/project-name/overview page, when I try to grab the code snippet to initialize my Firebase, the storage bucket shows up with empty URL.
Today, I started a new project, this time, using the Firebase console. After creating the project, the StorageBucket URL showed up in the initialization code snippet automatically.
When I check both project's storage rules, I see the URL pointing to the right places, however, the imported project gives this error under the Storage > Files tab:
It has been like this since day one I imported the project.
When I went to https://console.cloud.google.com/storage/browser to see if the new project I created would show, it did.
Are there any extra steps on my part to get the storage bucket URL to show for the imported project?
Who's this answer for?
If you imported your project into Firebase and having the above issue specifically with your Firebase Storage.
After back and forth with Firebase Support, if you're facing similar problems as mine, here's the approach you can try. I'm trying to replay the conversation and steps given by the Firebase Support
Make sure that you are the owner of the project you are accessing.
If you have multiple Google accounts signed in, Firebase Database can't
seem to connect to the server. Sign into incognito mode
Check in your API Manager if the following are enabled
a) App Engine admin API
b) Firebase Rules API
c) Google Cloud Storage
Check if you have an App Engine app is enabled https://console.developers.google.com/project/_/appengine
Go to Firebase Storage AppManager tab
https://console.cloud.google.com/storage/
a) Add the service account firebase-storage#system.gserviceaccount.com as an owner on the storage bucket: .appspot.com.
b) Additionally, you need to edit the "object default permissions" to allow for similar access.
Now, if you have all the above in place, next step is this:
Add new Server Credentials
In credentials page, ( https://console.developers.google.com/apis/credentials ),
click Create credentials, select API key
Select server key
Put name as "Server key (auto created by Google Service)"
At the time of writing this, creating the Server Key was what got it to work.
A few words:
The issue of not able to use Firebase properly when two accounts are logged in the same browser doesn't plague me anymore. Logged into two accounts, and both Firebase projects are up and running without any issue.
I fixed mine by using the command to work on it using
firebase init storage
This would create the storage after that it would add a storage.rule in which you can update to your liking in your project .
Then you run this command
firebase deploy --only storage
This would initialize the Storage
If you are still having issues check out this link https://stackoverflow.com/a/74750337 which was also provided by firebase for me to fix the error
This is how i fixed mine