Closed schinnaraju closed 6 years ago
Hi, thanks for feedback
In android the plugin retrieves extended data from the intent named userdata
as shown below
final Bundle b = intent.getExtras();
final String userData = b.getString("userdata", "{}");
The broadcast work but the extra data are empty when i parse from Javascript code. Is there anything missing in the code (I have updated with native code as well)
what does you mean with extra
?. As wrote above the plugin (by default) get only field userdata
from extras
i mean am not getting "userdata"
Ok got it
Let me check
One of reason could be that the string passed to extra is not valid json object
check out the new version 3.0.0
it doesn't use userdata
anymore
Android code Intent intentVal = new Intent("BarcodeReader");
Bundle b = new Bundle();
b.putString( "barcode", content+"");
b.putString( "userdata", "{ \"data\": \"test\"}" );
intent.putExtras( b);
LocalBroadcastManager.getInstance(MainActivity.this).sendBroadcastSync(intentVal);
but e prints as {} instead of actual data.