Skip to content
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

Removing the camera access manually from cellphone cause a permission problem in react-native-photo-upload #46

Open
saeedtkh opened this issue Aug 31, 2018 · 5 comments

Comments

@saeedtkh
Copy link

Hi, I am using this package in both IOS and Android and it is working well. But there is a problem in the following case of IOS. If the user go for uploading the photo for the first time, the package asking the permission for camera and library. Then if the user removes the access to camera or library manually from the privacy setting of the phone and go for the second time to upload the photo, nothing happens. In other words, the app doesn't ask for permission again it doesn't show any reaction. Can you please let me know what is the problem. thanks in advance.

@saeedtkh saeedtkh changed the title Removing the camera access manually from cellphone cause problem Removing the camera access manually from cellphone cause a permission problem in react-native-photo-upload Aug 31, 2018
@mihai-ro
Copy link

bump; any updates on this?

@gabrielgc
Copy link

@mihai-ro Did you manage to overcome this?

@aravi365
Copy link

@mihai-ro @gabrielgc did you guys fixed it someway??

@gabrielgc
Copy link

@aravi365 I managed it by checking the error message on response.
Inside onResponse

if (Platform.OS === 'ios' && response.error) {
...
if (response.error === 'Camera permissions not granted' 
|| response.error === 'Photo library permissions not granted') {
//here I have a message to the user to allow the camera/library access in their phone settings
...

If you want you can send them directly to your app settings by doing Linking.openURL('app-settings:')

@aravi365
Copy link

aravi365 commented Apr 23, 2020

if (response.error === 'Camera permissions not granted'
|| response.error === 'Photo library permissions not granted') {

it worked perfectly fine. Thumbs up for that! But about android, how did you managed it? @gabrielgc

For android when permission is denied then alert shows to navigate to settings. But even after giving permissions, when coming back and pressing the photo upload again, nothing happens. Need to restart the app after killing it, to make it work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants