I am trying to write my own native extension for scanning barcodes (as Rho.Barcode does not work with ITF Codes on image based scanners).
The Problem now is, that my original take method returns almost immediately and therefore setting the method result does not work.
I already tried to force the take() call to stay open by using a wait() notify() mechanism until my Decoding Activity sets the result and only then return. The problem with this approach is that as take() does not return right away the screen stays black and I do not even see the Decoding app.
Is there a possibility to simply call startActivityForResult() as in a normal android app and only return from the js call to take() once the onActivityResult() has finished?
Or alternatively, how could I give a js callback to my take() method and call it when I am done? I read the documentation on this but there is no example and I did not know how to get it running.
I'm running into almost the exact same problem. I'm implementing a barcode scan as well and I've read how to introduce callbacks but without an actual example I have no idea how it actually works. Did you ever come to a working solution?