Im not sure if this is possible, but when I used javascript with firebase (on the web), I was able to do something similar to OnUpdate() which fired every time the key was updated, is something like this feasible in this module, it would be a cool addition.
OnUpdate() which fired every time the key was updated
I’m not entirely sure, I would have to look further into the RESTful API for Realtime Database, but as far as I am aware this isn’t possible.
An alternative, however, would be writing an interface for Robase and having Signal
s for keys and attaching a function to run when they do change. As stated in the post though, saving upon data change is not at all recommended as you will eat through your download cap - I tested this and within ~2.5 weeks I had to disable the database before it encroached upon the limit.
Also, apologies for the late reply, I have been feeling under the weather and swamped with work, appreciate the suggestion though!
Really cool module, I’ve been using it for my games data storing.
The only criticisms I have are that I think you should probably use promises over pcalls and for the code to be a bit easier on the eyes. Some code needs to be spaced out.
Otherwise, as I said, a great module!
This is the plan for a future update, currently my PC is bust and I need to do some repairs, on top of this I’m unable to travel home due to Covid-19 restrictions and me being in a different country.
I have a lot of improvements to make on this that I plan to begin when I get the chance, thanks for the input!
Firebase is migrating to a new database authentication system. This is completely fine though, as deprecated does not mean removed!
Video tutorial:
You don’t need Database secrets, follow the video tutorial provided to access your auth key.
But there is like nothing there I am confused.
Oh my god thank you so much. Really funny, since last week I spent ages creating my own site to use as an API to update my firebase storage from website. You’re a lifesaver!
Thank you kindly for creating a video tutorial, I have now added it to the post under “Getting your authentication token”.
I’m glad that this is of use to you and I hope it’s easy to use and work with, any problems don’t hesitate to ask here, message me, or use the reporting issues section under the post!
Does this module/wrapper help handle or cache up http requests?
Firebase allows updating multiple arrays in a single request, just curious if you’re helping to keep HttpService activity down by grouping multiple requests into one every few seconds?
I’m not sure how well this would handle 70 players joining at once and grabbing data for many people.
Apologies for the delayed response, this module is simply a wrapper for the core functions that Firebase provide in their API.
There is a BatchUpdateAsync
which sends a request to the method Firebase uses to update multiple arrays with a PATCH request.
Caching and “proper” handling of requests is down to the programmer. I do plan to add on to this to make it easier to setup and install with little experience.
I hope this answers your question!
Hi, I don’t exactly understand the :BatchUpdateAsync
method. Could you provide an example script of using this?
Of course, here’s a method from my “DataHandler” script which handles uploading/downloading data and caching it, slight documentation included:
And the following is the documentation written for BatchUpdateAsync within Robase (I’m unsure how up to date everything is, but this is, as far as i know, the absolute most recent version):
Finally, apologies for the delayed response, I’m not on devforum on my phone often
Im using FirebaseService, and I’m getting FirebaseService>> [ERROR] HTTP 401 (Unauthorized)
Updated to v1.0.1 fixing a race condition(?) issue with GetAsync, it should know perform more reliably. Furthermore, revamped GetAsync’s internals to have less repeated code and more concise pcall functions.
Enjoy, folks!
Have you tried reloading your browser and trying again? I’ve just created a blank project and database and a secret was generated automatically for me and appears.
I can only assume this is an issue on your end.