Skip to content

Commit

Permalink
🐧 Issue #508: Is there any way to disable the beep in android?
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Aug 15, 2017
1 parent a0d8ac4 commit f316c4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ A full example could be:
formats : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device
disableAnimations : true, // iOS
disableSuccessBeep: false // iOS
disableSuccessBeep: false // iOS and Android
}
);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class BarcodeScanner extends CordovaPlugin {
private static final String SHOW_TORCH_BUTTON = "showTorchButton";
private static final String TORCH_ON = "torchOn";
private static final String SAVE_HISTORY = "saveHistory";
private static final String DISABLE_BEEP = "disableSuccessBeep";
private static final String FORMATS = "formats";
private static final String PROMPT = "prompt";
private static final String TEXT_TYPE = "TEXT_TYPE";
Expand Down Expand Up @@ -179,6 +180,8 @@ public void run() {
intentScan.putExtra(Intents.Scan.SHOW_TORCH_BUTTON, obj.optBoolean(SHOW_TORCH_BUTTON, false));
intentScan.putExtra(Intents.Scan.TORCH_ON, obj.optBoolean(TORCH_ON, false));
intentScan.putExtra(Intents.Scan.SAVE_HISTORY, obj.optBoolean(SAVE_HISTORY, false));
boolean beep = obj.optBoolean(DISABLE_BEEP, false);
intentScan.putExtra(Intents.Scan.BEEP_ON_SCAN, !beep);
if (obj.has(RESULTDISPLAY_DURATION)) {
intentScan.putExtra(Intents.Scan.RESULT_DISPLAY_DURATION_MS, "" + obj.optLong(RESULTDISPLAY_DURATION));
}
Expand Down

0 comments on commit f316c4e

Please sign in to comment.