Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get JSONObject from Default value of Firebase Remote Config

I need to fetch JSONObject from default value of Remote config in Firebase. By FirebaseRemoteConfig.getString(), it gets converted to the String, but not in the JSONObject, saying

org.json.JSONException: Unterminated object at character xx

I am attaching default values of remote config below:

  <entry>
    <key>welcome_message</key>
    <value>{"version" :1,"type":"category","name":"CATEGORY"}
    </value>
  </entry>

I am now attaching my Java Code below:

  String welcomeMessage = mFirebaseRemoteConfig.getString(WELCOME_MESSAGE_KEY);

  JSONObject categoryListInJson = new JSONObject(welcomeMessage);

Thanks in advance for the answers.

like image 516
Vipul K. Patil Avatar asked Nov 09 '17 10:11

Vipul K. Patil


1 Answers

It's bug on Android Studio 3.0 or above.

like image 67
kolin Avatar answered Sep 18 '22 20:09

kolin