You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
Describe the bug
On Android when asking for permission users has three options:
Allow only while using the app
Ask every time
Don't allow
When users select the second option "Ask every time" we should ask every time if it allows, but it is assuming as "denied" directly.
To Reproduce
Steps to reproduce the behavior:
Ask users for permission
Select the option "Ask every time"
Close the app
Go to app settings and change the permission to "Don't allow" and back to "Ask every time"
Open the app again
Ask users for permission
Expected behavior
It should ask for permission again because the options selected is "Ask every time"
Current behavior
The result comes straight as denied
Screenshots
The option "Ask every time" is selected:
When checking camera permissions it is returning denied as true:
Version
^4.0.0
Smartphone:
Device: Moto g(60)s
OS: Android 12
Additional context
This is the code that we are using:
public async cameraHasPermission(): Promise<boolean> {
// check if user already granted permission
const status = await BarcodeScanner.checkPermission({ force: true });
alert(`{ force: true } -- Status: ${JSON.stringify(status)}`);
if (status.granted) {
// user granted permission
return true;
}
if (status.denied) {
// user denied permission
await this.openCameraSettings();
return false;
}
if (status.asked) {
// system requested the user for permission during this call
// only possible when force set to true
}
if (status.neverAsked) {
// user has not been requested this permission before, we will prompt
// a message asking for the permission
const confirmed = confirm(await this.translationService.translateAsPromise(PermissionsTranslateKey.confirmCameraPermission));
if (!confirmed) {
await this.openCameraSettings();
return false;
}
}
if (status.restricted || status.unknown) {
// ios only, probably means the permission has been denied
await this.openCameraSettings();
return false;
}
// user has not denied permission
// but the user also has not yet granted the permission
// so request it
const statusRequest = await BarcodeScanner.checkPermission({ force: true });
alert(`{ force: true } -- Status: ${JSON.stringify(statusRequest)}`);
if (statusRequest.granted) {
// the user did grant the permission now
return true;
}
// user did not grant the permission, so he must have declined the request
await this.openCameraSettings();
return false;
}
The text was updated successfully, but these errors were encountered:
I have same bug
First time user select ask every time everything is correct and scanner works
second time no asking and blank screen, in logs I got "No Permission to use Camera"
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
On Android when asking for permission users has three options:
When users select the second option "Ask every time" we should ask every time if it allows, but it is assuming as "denied" directly.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should ask for permission again because the options selected is "Ask every time"
Current behavior
The result comes straight as denied
Screenshots
The option "Ask every time" is selected:
When checking camera permissions it is returning denied as true:
Version
^4.0.0
Smartphone:
Additional context
This is the code that we are using:
The text was updated successfully, but these errors were encountered: