I’m using App bridge 2. On the Android POS app, App bridge Scanner doesn’t ask for permission and doesn’t open the camera. But it works fine if the permission was already granted(while using the POS app barcode reader).
Here are some of my code snippets:
let features = Features.create(app);
let scanner = Scanner.create(app);
features.dispatch(Features.Action.REQUEST, {
feature: Group.Scanner,
action: Scanner.Action.OPEN_CAMERA
});
features.subscribe(Features.Action.REQUEST_UPDATE, function (payload) {
console.log('Features.Action.REQUEST_UPDATE', payload);
if (payload.feature[Scanner.Action.OPEN_CAMERA]) {
var available = payload.feature[Scanner.Action.OPEN_CAMERA].Dispatch;
// If the Camera Scanner actions were enabled, open a Scanner
if (available) {
scanner.dispatch(Scanner.Action.OPEN_CAMERA)
}
}
});
app.subscribe(Scanner.Action.CAPTURE, async function (payload) {
console.log({ payload });
});
Am I doing something wrong here?