Skip to content
Advertisement

How to Get Value from JSON in Firebase Remote Config

I am a novice to Android app development and Firebase.

I want to know how can I get the value (String & Int) in the JSONArray file stored in Firebase Remote Config?

I use Firebase Remote Config with the final goal to compare my app’s version code and priority level with the one stored in Firebase Remote Config to determine initiation of App Update notification, but so far I still unable get Remote Config value.

I tried to parse the JSON using Volley (jsonParse in MainActivity2 class), but it also didn’t work. (Error bad url)

I have several times tried to implement previous answers, but maybe because of my misunderstanding, all those came to no avail.

Can I declare an array to Firebase Remote config?

Can I get JSONObject from Default value of Firebase Remote Config

FirebaseRemoteConfig getString is empty

I also have read this interesting article about implementing in-app updates notifications with some specific criteria using Remote Config, but unfortunately for me, the codes are written in Kotlin.

https://engineering.q42.nl/android-in-app-updates/

test_json file stored in Firebase Remote Config.

JavaScript

MainActivity2 class

JavaScript

Lessons class

JavaScript

Any help would be greatly appreciated.

Thank you.

Advertisement

Answer

For me worked like that

JavaScript

so observe in compose

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement