How to properly setup firebase refresh remote config time

Hello guys. I’ve just started using firebase and I wanted to make an app for my store with promotions (like free apps for a limited time).
I wanted to do so using a label and firebase remote config.
When the app starts, the label should be refresh its data.
On first start it gets the data and if I go to settings and clear app cache and data, it also gets updated but when I exit and relaunch the app, the data doesn’t get modified after I modified the value in firebase settings. Also a refresh button that I’ve added doesn’t work.
I think is a cache problem but idk how the number works. I’ve tried setting the cache number from the default to 1 but it still don’t solve the issue.
How does this number work?
If I put 1, will the cache expire in 1sec? 1minute? 1hour?
How does this number work?

1 Like

Are you using TinyDB as well?

What I do, is I have a “GetSubsbcription” proceedure.

it checks the version (which allows me to shut down a version for everyone)
it checks subscription level
It checks the values for the subscription
tt check the expiration date.

This all based on ensuring that the relevant data is NOT stored locally. I do not use TinyDB for any data that needs to be online.

Make sure you have a proper routine kicking off at startup checking firebase. So make sure you have a proper GET procedure to check Firebase for updates.

No, I’m not using tiny db.
If you want to give a look at the code, here’s the aia file Lite_Tools_promotions.aia (17.2 KB)

You will understand more than me for sure

You are using remote config. Is there a reason and not just a realtime DB?

Well, I’ve just started using online features on my apps so I don’t know much about all these things.
I’ve noticed that firebase component and tought that it was perfect for the use that I need.
Btw now I think that this is a cache problem and not a connection or a setup issue if I wait some time (idk exactly how much) and I open the app, it gets update.
So how do I use the cache setup?
If I put 1 after how much time will cache expire?

1 Like

I have the same problem as you do.
The cache is in ms, so by default it’s 43 seconds, which shouldn’t take hours to update.
EDIT : I give up, firebase remote config has too much problems, i will use database instead

2 Likes

As the team told at the update it could be that the new firebase feature have may some tiny problems which will be solved with the next updates.
Stay tuned.

3 Likes

Ok thanks ! I will use Firebase DB for the moment

1 Like

Actually the problem is, cache is not in ms it is in seconds “by mistake” . and default value is 43200 which is 12 hours so cache will expire after 12 hrs .

but you can put cache expiration time to minimum 3600 seconds which is 1 hrs. Now this is also a problem that 3600 value is also set in backend program, so you can not put less then 3600. if you put less value, it by default takes 3600 seconds. i don’t know why
:roll_eyes:
so you can put 3600 in cache expiration & your cache will expire after 1 hr and then you can fetch new value
just try it and tell what happened.

if you put less than 3600 second, it by default takes 3600 seconds as cache expiration time because of the Backend program.