I am getting the data payload from the firebase not in json format, instead I am getting custom key-value pairs as following format:
Data Payload:{image=htt
I am getting the data payload from the firebase not in json format
Yes
, Its behaving as intended.
Because Data payload contains custom key-value pairs
not a JSON
format
I have to parse the data using
Json
parsing for further processing.
You need to use Map<String, String>
to convert data payload in to a JSONObject
check below example
SAMPLE CODE
Map<String, String> params = remoteMessage.getData();
JSONObject object = new JSONObject(params);
Log.e("JSON_OBJECT", object.toString());