Phonegap-plugin-barcodescanner: Button for cancelling the barcode scan and closing the camera

Created on 12 Dec 2017  路  9Comments  路  Source: phonegap/phonegap-plugin-barcodescanner

Expected Behaviour

It's necessary to have a cancel button on-screen apart from the hardware back button to close the camera.

Actual Behaviour

On Android, when the plugin opens the camera and you press the hardware back button, the event propagates, causing Ionic apps to trigger the back button on the view as well, causing unexpected view exits.

Steps to Reproduce

  1. Start an Ionic2 app
  2. Install the plugin
  3. Call the scan method
  4. Press the back button

Cordova CLI version and cordova platform version

cordova --6.5
cordova platforms android 6.2.1

Plugin version

Latest

question wontfix android

Most helpful comment

Can anyone tell me how to add back button on a camera, rather than hardware have on it?

All 9 comments

For the back button problem
https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/355

Not closing as a duplicate in case somebody wants to add the back button functionality

@alejandro-heredia-coderoad-com you could set a boolean flag to let the app know you've entered the barcode scanner UI then check the value in your backbutton event handler.

I also have this problem.
The app just quits. It does not pause, it quits.

When bringing up the application afterwards, it's like a normal app start.

@macdonst Seems to be a lot of inactivity here. Can someone make me a contributor so I can get these things sorted for everyone?

Anybody can contribute by sending PRs, you don't need to be a contributor to do that. After a few contributions macdonst will probably make you contributor.

@jpike88 like @jcesarmobile said, sends some PR's first then we can worry about contributor status.

Can anyone tell me how to add back button on a camera, rather than hardware have on it?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This thread has been automatically locked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bajranghudda1 picture Bajranghudda1  路  4Comments

ishanjain2801 picture ishanjain2801  路  3Comments

joshstrange picture joshstrange  路  4Comments

luckylooke picture luckylooke  路  6Comments

klickagent picture klickagent  路  3Comments