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

Android - Denying permissions to use camera is not handled #2198

Closed
kidroca opened this issue Apr 1, 2021 · 8 comments · Fixed by #2114
Closed

Android - Denying permissions to use camera is not handled #2198

kidroca opened this issue Apr 1, 2021 · 8 comments · Fixed by #2114
Assignees

Comments

@kidroca
Copy link
Contributor

kidroca commented Apr 1, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Expected Result:

Trying to use the camera, but you have previously denied permissions the app should clearly indicate that
you need to update permissions in settings (since we're no longer allowed to ask)

Actual Result:

You try to use the camera the attachment menu just closes without explanation

Action Performed:

  1. Have a freshly installed app, or set app camera permissions to "deny" in settings
  2. Open a Chat
  3. Select the plus (+) button
  4. Select "Add attachment"
  5. Select "Take Photo"
  6. You are prompted for permissions
  7. Select "Deny & don't ask again"
  8. You can optionally restart the app at this point (it won't matter)
  9. Select the plus (+) button
  10. Select "Add attachment"
  11. Select "Take Photo"
  12. The menu closes. Nothing else happens. You see no message.

Workaround:

The user needs to go in Android settings, search for "permissions" or go to e.cash settings and manually set permission to "allow"

Platform:

Where is this issue occurring?

Web
iOS
[x] Android
Desktop App
Mobile Web

Version Number: 1.0.10-2 (First sawed on 1.0.6-3)
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Android_Deny_Permissions.mp4

For comparison on iOS this works correctly and you'd see this when you have denied permissions:
image

@kidroca
Copy link
Contributor Author

kidroca commented Apr 1, 2021

I've already addressed this in #2114 as it was directly related

@Julesssss
Copy link
Contributor

Tested this flow as part of the other PR. The old 'Permission denied' Dialog is displaying before the native permission dialog gets a chance to display. This is on Android 8.1. Any idea for why I'm not seeing the same flow as you?

@kidroca
Copy link
Contributor Author

kidroca commented Apr 6, 2021

@Julesssss
You mean this one right:
image

I don't know why I'm not getting that I've used both a Physical Android 8.0 device and a Emulator with Android 10.0

This is what I do:

  • npm run android
  • Go to settings / apps / app permissions and turn of camera permissions
  • Then I'll get the updated error as per this screenshot
    image

I've searched the error and it turns out it comes from the default configuration: https://github.com/react-native-image-picker/react-native-image-picker/blob/2.3.4/docs/Reference.md

BTW We can update to an up to date version now as per: https://github.com/Expensify/Expensify.cash/pull/1036/files#r550156553 and use error codes for error handling

@Julesssss Julesssss reopened this Apr 6, 2021
@Julesssss
Copy link
Contributor

Whoops, didn't mean to close this!

@Julesssss Julesssss added the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Apr 6, 2021
@MelvinBot
Copy link

Triggered auto assignment to @peterdbarkerUK (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Apr 6, 2021
@peterdbarkerUK
Copy link
Contributor

I reproduced the same as this:
image

Is that the error you're referring to @kidroca? Or did something else occur in the original bug report?

@kidroca
Copy link
Contributor Author

kidroca commented Apr 10, 2021

@peterdbarkerUK
This is the correct behavior since the fix is already merged.

Prior merging #2114 (v1.0.10) pressing "Take photo" would do nothing when you had denied permissions

For some reason @Julesssss sees a different message. There's a good chance it's because the image picker version is a legacy version. But it's still an improvement over pressing a button and nothing happening.

Both ios and Android alert popups we updated with the above message

I can open a PR to update the library and update the error handling as necessary

@peterdbarkerUK
Copy link
Contributor

Sweet, thanks for clarifying other Peter! Closing this issue out :-)

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

Successfully merging a pull request may close this issue.

4 participants