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

feat: If camera permission is denied, allow the user to approve it again #1583

Merged
merged 8 commits into from
Apr 17, 2022

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Apr 15, 2022

  • Support for rationale (Android)
  • If the permission is denied, no barcode decoder is launched
  • When the app is resumed, check if the permission is still available
  • Value saved on user preferences was totally useless, since Android/iOS provide the same info
Camera.mp4

Fix #1564

@g123k g123k added permissions 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion… labels Apr 15, 2022
@g123k g123k requested a review from a team as a code owner April 15, 2022 13:55
@g123k g123k self-assigned this Apr 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 15, 2022

Codecov Report

Merging #1583 (f763eb1) into develop (2ea0da3) will decrease coverage by 0.01%.
The diff coverage is 2.89%.

@@            Coverage Diff             @@
##           develop   #1583      +/-   ##
==========================================
- Coverage     8.86%   8.84%   -0.02%     
==========================================
  Files          161     162       +1     
  Lines         6623    6693      +70     
==========================================
+ Hits           587     592       +5     
- Misses        6036    6101      +65     
Impacted Files Coverage Δ
...s/smooth_app/lib/data_models/user_preferences.dart 34.42% <ø> (+2.11%) ⬆️
...mooth_app/lib/generic_lib/widgets/smooth_card.dart 0.00% <ø> (ø)
...oth_app/lib/pages/onboarding/country_selector.dart 0.00% <0.00%> (ø)
...ges/smooth_app/lib/pages/product/summary_card.dart 0.00% <0.00%> (ø)
...es/smooth_app/lib/pages/scan/ml_kit_scan_page.dart 0.96% <0.00%> (ø)
...mooth_app/lib/widgets/smooth_product_carousel.dart 0.00% <ø> (ø)
...ages/smooth_app/lib/helpers/permission_helper.dart 3.22% <3.22%> (ø)
packages/smooth_app/lib/pages/scan/scan_page.dart 4.10% <3.38%> (+1.60%) ⬆️
...ges/smooth_app/lib/pages/scan/scanner_overlay.dart 5.71% <5.88%> (+5.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 052b0c0...f763eb1. Read the comment docs.

@g123k g123k changed the title feat: If camera permission is denied, allow the user the allow it again feat: If camera permission is denied, allow the user to approve it again Apr 15, 2022
@teolemon
Copy link
Member

Perhaps a slight visual tweak
image

@g123k
Copy link
Collaborator Author

g123k commented Apr 16, 2022

Is-it better like so @teolemon?
Screenshot_1650108838

@teolemon
Copy link
Member

👍

@M123-dev
Copy link
Member

Just one thing, as far as I know opening the settings for manual permission approval isn't supported on iOS

@g123k
Copy link
Collaborator Author

g123k commented Apr 16, 2022

@M123-dev Don't worry, it works well on iOS

RPReplay_Final1650125230.MP4

@M123-dev
Copy link
Member

Perfect @g123k this simplifies everything. A older version had this in the docs:

[...] The user may still change the permission status in the settings. Only supported on Android.

@g123k
Copy link
Collaborator Author

g123k commented Apr 16, 2022

Actually that’s also the case in iOS.
But even when the user changes the permission outside the app, the popup will still be correctly displayed when needed

@teolemon teolemon force-pushed the camera_permission branch from bbc4370 to 8b0adc5 Compare April 17, 2022 17:16
@teolemon teolemon merged commit e2aa72d into develop Apr 17, 2022
@teolemon teolemon deleted the camera_permission branch April 17, 2022 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub 🌐 l10n merge conflicts permissions 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…
Development

Successfully merging this pull request may close these issues.

What should we do if the camera permission is denied?
4 participants