New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Android permission #140

Open
cfjedimaster opened this Issue Nov 12, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@cfjedimaster

cfjedimaster commented Nov 12, 2018

In order for this to work on Android, you must add:

<uses-permission android:name="android.permission.CAMERA"/>

While this is obvious, it really should be mentioned in the readme guide.

@zbranzov

This comment has been minimized.

Contributor

zbranzov commented Nov 16, 2018

@cfjedimaster Both demo apps are working fine on Nexus 5X Android 8.1 even though they don't have this permission added. Why do you think it is a requirement?
You can take permission via code:

camera.requestPermissions().then(() => {
   // you can take photos now
}).catch(() => {
   // user denied permissions
});
@cfjedimaster

This comment has been minimized.

cfjedimaster commented Nov 16, 2018

In my testing, when I had code that used requestPermissions, and tried to take a picture, I'd see the native prompts ("app wants to blah blah"), but the catch block would fire with: [Error: Application does not have permissions to use Camera]

This is an example of what I was trying:

camera.requestPermissions()
.then(() => {
	camera.takePicture({ width: 300, height: 300, keepAspectRatio: true, saveToGallery:true })
	.then(imageAsset => {
		this.img = imageAsset;
	})
	.catch(e => {
		console.log('error:', e);
	});
})
.catch(e => {
	console.log('Error requesting permission');
});
@zbranzov

This comment has been minimized.

Contributor

zbranzov commented Nov 19, 2018

@cfjedimaster What device do you use when it fails?
Did you try whether demo apps cause the same error?
We are testing on android emulators and real devices using the apps from the repository and haven't seen any problem so far.

@cfjedimaster

This comment has been minimized.

cfjedimaster commented Nov 19, 2018

Device: Pixel 3 XL.
I did not try demo apps - but I've tried it in two apps so far. The one I just tried had the same error (I mean the catch block throwing).

1 similar comment
@cfjedimaster

This comment has been minimized.

cfjedimaster commented Nov 27, 2018

Device: Pixel 3 XL.
I did not try demo apps - but I've tried it in two apps so far. The one I just tried had the same error (I mean the catch block throwing).

@cfjedimaster

This comment has been minimized.

cfjedimaster commented Nov 27, 2018

I am VERY sorry - I wrote the above comment and never hit enter.

@cfjedimaster

This comment has been minimized.

cfjedimaster commented Nov 27, 2018

Oops, or maybe I did in another tab - sorry for the noise.

@DKhalil

This comment has been minimized.

DKhalil commented Dec 5, 2018

@cfjedimaster hey, so there are quite a few files containing the permissions. Which file did you add it to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment