I am successfully managing to take a photo and upload it to firebase if I have an internet connection. I have also seen that you can set firebase database to persist data when offline but I can't see any documentation on if this is possible with firebase storage.
If this isn't possible what is the best way to approach this if any? Should I save images as base64 then to sharedPreferences? Or as actual files then upload them?
Thanks for any insights
Yeah, I had the same problem. Persistence in Firebase Storage in flutter is not working. I don't know why, but this plugin in Dart helps to cache images from the given url for faster loading. Have a look at this plugin.
Related
I'm saving videos to Firebase Storage and creating a URL for it which I saving into Cloud Firestore. So when ever someone watch a video I call the URL and Firebase downloads it. That increased my project costs enormously.
The question that I have is, is there a way to save the mp4 files cheaper?
And maybe also make it faster to download?
The best solution will be if I can like I used before. So in the new solution, also use the download URL which I saved in cloud Firestore. So that I don't need change too much. My Project is using Flutter in client side.
I created a mobile app, where user can upload videos for example like Instagram or TikTok.
I'm willing to pay if you freelancer and can help.
You can use Youtube or Vimeo to store your videos for free (Vimeo is limited to 500mb).
Then you can use a package from pub.dev to display these videos.
YouTube package (does not support to download the file, only playback)
Vimeo package (max 500mb, then you have to pay)
So both have their advantages and disadvantages.
It is possible to upload videos to YouTube using Google API. There is an example done using flutter which can be ideal for your use-case. Have a look at this video on youtube.
I see this question has already been asked but not all that recently so I am bringing it up again.
How do you hide your firebaseConfig file, or any secret key, in an expo application? (For production, not dev).
As far as I can tell, there is no way to properly hide the firebase config file with API keys etc in a react-native expo app.
Being that I have already built my entire app around interacting with firestore, I am a bit perplexed as to how to proceed forward.
If I eject, is there a way to properly hide my API key in a non-expo react-native-app? Or will I still face the same problem? Everything is working smoothly and I would prefer not to eject.
I have some experience using node.js/express.js as a backend (only ever in a development setting). Should I build myself a server and then serve the config info from there?
If I want to deploy a 'demo' app, is there a way to hide the keys while still using expo?
Any insight into this would be so helpful.
As far as I am aware there is no 'dotenv' package compatible with expo.
Also I have zero experience in deploying mobile apps, and very little in deploying web apps. I have not yet had to deal with securing keys in deployment.
Any help would be so appreciated.
It's not possible to effectively hide your Firebase config information. The best you can do is make it more difficult for someone to find them. Since all the JavaScript code is running on a computer or device that you don't control, you can't ensure that any of it is hidden from view.
In fact, you don't need to hide any of that. I suggest reading this: Is it safe to expose Firebase apiKey to the public?
If you're using Realtime Database, Firestore, or Cloud Storage, you should be using security rules to protect data so that only authorized users can access it.
Since I am not using the Google Cloud Platform App engine service anymore, I disabled it and got the following error on Firestore:
The workaround I could find is just to deploy a dummy app engine fully managed application. Still I think this should not be the right way of doing things.
Is there another way? Why did Google choose to link Firestore to App Engine?
firebaser here
Cloud Firestore is an evolution of Cloud Datastore, which in turn is the (originally unnamed) database in App Engine.
So it's not as much that Firebase chose to link Firestore to App Engine, as it is that we can't unlink it from App Engine without rewriting a lot of infrastructure. That may happen at some point, but at the moment you'll need to keep App Engine enabled to use Firestore.
By the way: this is also the reason that for a long time you could set a spending limit on Firestore, but not on other Firebase products: it inherited its spending limit from its App Engine lineage. When the ability to set a spending limit disappeared from App Engine, Firestore also lost that ability.
A lot of Google Cloud products are actually linked to App Engine deep down inside cloud projects. I'm not sure anyone is going to be able to give you a satisfactory explanation of why this is (unless it's coming from an engineer from Google). But I can tell you that it's a long-standing legacy of the way cloud projects work. App Engine is the original Google Cloud product, and much cloud infrastructure was built around it. That's all implementation details, and you don't need to know why that is - all you have to do is enable the App Engine API, even you don't use it directly.
I am developing an iOS/Android app with Flutter and Firebase (mainly Cloud FireStore and Firebase Auth). According to the Firebase documentation/example, they just put the API key along with the googleAppID straight into the app's source code. This to me seems very insecure, but at the same time I did hear that dart is compiled AOT. So what is the best practice for putting the Firebase API keys in a Flutter app?
Any response is appreciated!
That example is usually not followed. The key is stored in the google-services.json file or the equivalent for iOS that should be added to the project following the Firebase setup instructions. This removes the issue with people easily knowing your key. I don't believe it would matter if someone did however as the key is intended to be public.
Setup Instructions
I have a project for both Android and iOS that's using cloud functions for same app behavior and consistent data storing. For now we were debugging apps on single database, storage and authentication.
The problem is when I switch to release variant I want functions to operate on release database, storage and auth.
I've been searching for an answer to my problem and all I've found was this: How to access multiple Realtime Database instances in Cloud Functions for Firebase
but it doesn't help too much.
Is there a way to go about that without making another Firebase project for release variant?
Ok, so basically just a while after posting this question I've found official firebase guide that helped me resolve this issue.
Short answer: no, you have to create another project in Firebase as described in guide.