Follow

Crashes or other oddities are happening in the success callback

Starting with version 4.10 the successCallback is called in the engine thread instead of the main thread. Because of this you have to switch to the main thread for any UI specific operations like removing the scanner from the view hierarchy etc. The easiest way of doing this is by using setTimeout:

picker.setSuccessCallback(function(e) {
      picker.stopScanning();
      setTimeout(function() {
         // Code that manipulates the UI.
      }, 1);
});

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request