{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner/issues/214","repository_url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner/issues/214/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner/issues/214/events","html_url":"https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/214","id":151782241,"number":214,"title":"phonegap/cordova plugin never calls return success or error function","user":{"login":"rocifier","id":1772304,"avatar_url":"https://avatars.githubusercontent.com/u/1772304?v=3","gravatar_id":"","url":"https://api.github.com/users/rocifier","html_url":"https://github.com/rocifier","followers_url":"https://api.github.com/users/rocifier/followers","following_url":"https://api.github.com/users/rocifier/following{/other_user}","gists_url":"https://api.github.com/users/rocifier/gists{/gist_id}","starred_url":"https://api.github.com/users/rocifier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rocifier/subscriptions","organizations_url":"https://api.github.com/users/rocifier/orgs","repos_url":"https://api.github.com/users/rocifier/repos","events_url":"https://api.github.com/users/rocifier/events{/privacy}","received_events_url":"https://api.github.com/users/rocifier/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-29T02:31:02Z","updated_at":"2016-05-13T03:29:51Z","closed_at":null,"body":"In phonegap I wrote a function, which I call when I press a link:\r\n\r\n```\r\nfunction scanBarcode(){\r\n   cordova.plugins.barcodeScanner.scan(\r\n\t  function (result) {\r\n\t\talert(\"scanned cancel: \" + result.cancelled);\r\n\t    if (!result.cancelled) {\r\n\t\t\talert(\"Scanned barcode: \" + result.text);\r\n\t\t\t$(\"#current-code\").val(result.text);\r\n\t\t}\r\n\t  }, \r\n\t  function (error) {\r\n\t\t  alert(\"Scanning failed: \" + error);\r\n\t  }\r\n   );\r\n}\r\n```\r\n\r\nOn android 4.4.2 the scanner pops up, and I can scan a barcode, then control is returned to my application but none of the alerts ever pop up. I checked logcat and there is no error or warning messages, nothing. Using latest phonegap version and cordova plugin. I also tried using the current github version but it's the same."},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner/issues/comments/218943974","html_url":"https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/214#issuecomment-218943974","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-barcodescanner/issues/214","id":218943974,"user":{"login":"rocifier","id":1772304,"avatar_url":"https://avatars.githubusercontent.com/u/1772304?v=3","gravatar_id":"","url":"https://api.github.com/users/rocifier","html_url":"https://github.com/rocifier","followers_url":"https://api.github.com/users/rocifier/followers","following_url":"https://api.github.com/users/rocifier/following{/other_user}","gists_url":"https://api.github.com/users/rocifier/gists{/gist_id}","starred_url":"https://api.github.com/users/rocifier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rocifier/subscriptions","organizations_url":"https://api.github.com/users/rocifier/orgs","repos_url":"https://api.github.com/users/rocifier/repos","events_url":"https://api.github.com/users/rocifier/events{/privacy}","received_events_url":"https://api.github.com/users/rocifier/received_events","type":"User","site_admin":false},"created_at":"2016-05-13T03:29:51Z","updated_at":"2016-05-13T03:29:51Z","body":"Yeah it's definitely reloading my whole app when it resumes from taking a photo. My base index.js is being evaluated. That means my app.initialize(); is being called which re-binds all events including pause() and resume(). Then resume() is being called."}}