I'm using Firebase Storage to store images for my app project. The image urls are stored in Firestore. The problem is that all those urls are huge. Sometimes in the Firebase Console it get double scroll bars because of that. Is there any way we can make them shorter? Thanks!
Actually Firebase Dynamic Links would be a nice one solution for your situation.
You can make it runs following these instructions in this article from Medium, I have just implemented it in one of my Apps and it worked as expected.
I hope it helps you and everyone having the same issue.
Related
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.
I'm facing an issue where when I sign out a user (using FirebaseAuth.signOut() method) and sign in with another user, information of the previous user are loaded instead of the new one.
I believe this is caused by this information still being accessible in firebase's cache.
Is there a way to force firebase to clear its local cache?
Cheers!
For Android, there is FirebaseFirestore.clearPersistence().
For JavaScript/web, there is Firebase.clearPersistence().
For iOS, there is Firebase.clearPersistence().
Flutter does not seem to have this API yet.
Bear in mind that the clearPersistence API is not meant for the specific case you're talking about. If you read the API docs carefully, you can see they're meant for testing.
You might want to do a little more debugging to figure out what exactly it is that's not working the way you expect. Since you're not showing any code, it's hard to tell if you might be doing something wrong.
You can use the async call FirebaseFirestore.instance.clearPersistence(); for flutter projects.
Check this answer.
If clearPersistence() doesn't work, Programmatically restart your app
you can restart your app like this: https://stackoverflow.com/a/50116077/10041654
in addition, while restarting init your firebase: https://github.com/The-ring-io/flutter_phoenix/issues/27#issue-1490150037
How to send notification to user on data changes in database using firebase ?
I am newbie and searched everywhere no such help.. please help me.
I got to know that it's possible using firebase cloud function but I did not got any example code to understand it. So please help by giving any example code.
Have a look at the first use-case mentioned in the Firebase documentation and the sample code for that use-case. They quite literally describe what you're asking for.
Note that this code is non-trivial, since the entire use-case is quite involved. You will have to make sure you understand all parts well, before you try to make any changes to the sample code. To get this understanding, you might be better served by following the more basic documentation for the Realtime Database and Cloud Messaging, and the codelab for iOS, Android, and/or Web.
I was thinking of making an app which plays a specific set of small audio files stored away in a firebase database, or any other database on the cloud.
The number of files may exceed hundreds, so wrapping all the files in the app might not be the best of ideas.
I'd really like to know how to go about this problem.
Downloading only the required file from firebase when it's clicked and playing as its being downloaded all the while caching it for future playback seems plausible, but I'm not quite sure how to implement it.
I'd appreciate a few pointers towards this, thanks
Yes. You are thinking in the right direction.
You might use these things.
App UI - Ionic2 will provide you a very nice and easy to implement platform to create a UI. Please refer this documentation for the basics and details about using Ionic2.
Local Storage - You can use this to store downloaded files. In any app where data is relatively large, using local storage is the smart choice. This helps you reducing the size of the initial app to be installed and download the content as and when needed.
A well defined database - Now, whether to use non-structured (No-SQL) or structured (SQL) is the first choice you have to make.
If it's just content - audio files download and play with no complex cross querying the database, then you can choose to use non-structured (No-SQL) database like Firebase database.
But, if you have good requirements for structuring data, query it with constraints like "Give me all the audio files list where a particular user has played it in last 10 days" or "Give me all the users who has played/downloaded a particular audio file more than 10 times" and so on, then you better use structured (SQL) database like PostgreSQL.
RxJS - Now, this might not be very important to do, but, if you use this from the start, it's a good choice. Advantages are, e.g. you might not have to wait for all the file to get downloaded before playing it. Use Observables and Promises for such a mechanism.
Could help with the specifics when needed. Hope this helps. :)
I am building an app using worpress as the backend and ionic as the front end. I know there are a number of metods to store data offline, what is the most robust option? I will be deployning on ios and android and the data may contail larger files, i am leaning towards using the file api and saving .json files?
Did you look at the Storage guide in the Cordova docs? (http://cordova.apache.org/docs/en/4.0.0/cordova_storage_storage.md.html#Storage)
The "best" approach depends on what you are storing. If you are storing text based content, then WebSQL is probably best for you. If you are storing data that is more abstract (last article viewed, number of times something has been read, etc) then LocalStorage may be better.
Finally - I tend to only use the file system for binary data, like images, video, etc.