feat: complete Android permission UX for camera, location and push#101
Open
xJeffx23 wants to merge 1 commit into
Open
feat: complete Android permission UX for camera, location and push#101xJeffx23 wants to merge 1 commit into
xJeffx23 wants to merge 1 commit into
Conversation
feat: Android permission UX for camera, location and push - usePermission hook: 3 hooks, 4 states each (prompt/granted/denied/permanently_denied) - PermissionGate component: rationale, denied, settings CTA, fallback slot - PushPermissionBanner: check-on-mount, inbox works without push - ExploreMap: rationale gate before OS dialog, zone fallback when denied - MerchantInbox: camera gate, manual paste fallback, appStateChange recovery - AndroidManifest: POST_NOTIFICATIONS + hardware features required=false - Wire capacitor-push-notifications into Android build)
|
@xJeffx23 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #78
Problem
The APK had no permission experience: features silently broke when denied, no rationale before the OS prompt,
no path to recover from permanent denial.
Changes
New files
src/hooks/usePermission.ts— three hooks (camera, location, push) each handlingprompt / granted / denied / permanently_deniedsrc/components/PermissionGate.tsx— reusable gate: rationale screen → OS prompt → denied card → permanently-denied cardwith settings CTA → fallback slot
src/components/PushPermissionBanner.tsx— non-blocking inline banner for merchants; inbox remains functional at allpush states
Modified files
useGeolocation.ts— check-only on mount (no auto OS dialog); rationale shown first via ExploreMap gate;appStateChangelistener recovers state after settingsuseQRScanner.ts— already used check-before-request; confirmed correctExploreMap.tsx— showsPermissionGateforpromptstate on native before triggering OS dialog; zone-based searchfallback when denied
MerchantInbox.tsx—PermissionGatewraps scan area; manual QR paste fallback;appStateChangere-checks camera onreturn from settings
AndroidManifest.xml—POST_NOTIFICATIONSdeclared; all hardware featuresrequired="false"capacitor-push-notificationswired into GradleAcceptance criteria
appStateChange+app-settings:on Capacitor 8)Test plan
npx tsc --noEmit)npm run build)adb shell pm reset-permissions com.micopay.appbetween runsDependencies
Provides the permission infrastructure for:
If there is any point for improvement, please let me know and I will fix it.🚀