Send JSONObject as Bundle not working for Android
See original GitHub issueI want to send a simple JSON object but the plugin was not able to convert it correctly to JSON
I want to send this simple JSON
{ "data":{ "testingkey":"testingValue" } }
So according to the documentation should be something like this
val bundle1 = Bundle()
bundle1.putString("testingkey", "testingValue")
val bundle2 = Bundle()
bundle2.putBundle("json", bundle1)
intent.putExtra("data", bundle2)
After that in the listener when I put the log to see the response
console.log(JSON.stringify(e, null, "\t"))
I got this:
{ "isTrusted": false, "data": "Bundle[{json=Bundle[{TestingKey=TestingValue}]}]" }
Note that I don’t want to send the JSON as string because if I try something like this:
intent.putExtra("data", jsont.toString())
I got this:
{
"data":"{\"testingkey\":\"testingValue\"}"
}
So it appears that your plugin is supporting just one depth in the JSON Object
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Passing JSONObject into another activity - Stack Overflow
I was thinking that I would be able to pass a JSONObject that contains all the data for a dvd movie instead of...
Read more >JSONObject - Android Developers
Although this class is nonfinal, it was not designed for inheritance and should not be ... so this is lossy; use strings to...
Read more >Android - JSON Parser - Tutorialspoint
This chapter explains how to parse the JSON file and extract necessary information from it. Android provides four different classes to manipulate JSON...
Read more >JSON Parsing Tutorial With Example In Android Studio [Step ...
A JSONObject represents the data in the form of key and value pair. JSONObject values may be any mix of other JSONObjects, JSONArrays,...
Read more >Introduction to JSON-Java (org.json) - Baeldung
Learn the fundamentals of parsing and manipulating JSON data with the JSON-Java library.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fix released in 4.0.0
hi @alejouribesanchez
It must be, I’ll work on