[MOD-2445] ti.barcode iOS : Camera overlay view randomly disappear after a period of time if you leave the scanner open but don't scan a code

GitHub Issuen/a
Resolution Date2018-08-13T07:05:51.000+0000
Affected Version/sn/a
Fix Version/sTi.Barcode iOS 2.0.1
ReporterVijay Singh
AssigneeVijay Singh


As discussed [here| https://github.com/appcelerator-modules/ti.barcode/issues/77] camera overlay view randomly disappear after a period of time if you leave the scanner open but don't scan a code. Sometimes 5 seconds after opening, other times up to a minute, very random. Thought it might have been to do with touch or orientation, but have been unable to reproduce it reliably.


  1. Joe Finnigan 2018-08-06
       var Barcode = require('ti.barcode');
       Barcode.allowRotation = false;
       Barcode.useLED = false;
       var $ = this;
       $.capture = function() {
         var overlay = Ti.UI.createView({
           backgroundColor: 'red',
           opacity: 0.4
           animate: false,
           overlay: overlay,
           showCancel: false,
           showRectangle: false,
           keepOpen: false,
           allowMenu: false,
           allowInstructions: false
       $.openScanner = function() {
       $.closeScanner = function() {
       $.showResult = function(e) {
       Barcode.addEventListener('success', $.showResult);
  2. Hans Knöchel 2018-08-06 It is probably GC'd, so we need to retain it's proxy status with rememberProxy and forgetProxy (later) in [here](https://github.com/appcelerator-modules/ti.barcode/blob/master/ios/Classes/TiBarcodeModule.m#L81), similar to overlays in [Ti.Media.showCamera(args)](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/MediaModule.m#L938).
  3. Vijay Singh 2018-08-08 You are right [~hknoechel]. PR - https://github.com/appcelerator-modules/ti.barcode/pull/78 [~jfinnigan] Can you please verify using [Pre-release 2.0.1| https://github.com/appcelerator-modules/ti.barcode/releases/tag/ios-2.0.1]
  4. Joe Finnigan 2018-08-09 Overlays are no longer disappearing! However, any onClick events on the overlays aren't firing, these were working previously, however may have been pre-2.0.0 rather than an new bug introduced with this fix?
  5. Vijay Singh 2018-08-10 Click event on any button on overlay view is firing. But it is not firing from overlay itself. It is not due to this change but it is from 2.0.0. Before 2.0.0 it's working fine. I'll look in this. Thanks for reporting [~jfinnigan].
  6. Vijay Singh 2018-08-13 Fixed the overlay 'click' event issue and updated the [Pre-release 2.0.1](https://github.com/appcelerator-modules/ti.barcode/releases/tag/ios-2.0.1) .

JSON Source