Use the reviewed permissions and integrations contract
Driver App permissions have at least four distinct states: what JavaScript requests, what the app declares, what the final native build effectively contains, and what the operating system reports at runtime. None can substitute for another.
The reviewed source has a permission-completeness defect and incomplete listener cleanup. This contract is source-only and does not certify effective grants, native/provider behavior or a deployed backend.
Availability
Requested location permissions vary by platform and Android OS version. The reviewed JavaScript asks iOS for when-in-use and always location. An intended Android 10 branch lists background location, activity recognition, fine and coarse location, but actual selection is not established because the version value and comparison type differ. Android 11 or newer requests activity recognition plus fine/coarse but omits background location from this list; older Android requests fine location only.
Native declarations include additional location, service, notification, vibration, contact and provider capabilities. Declaration does not prove a runtime request, grant, use, or final merged-manifest result.
Prerequisites
- Inspect exact platform/OS requested set and final built native declarations.
- Model unavailable, denied, blocked, limited and granted separately.
- Require an awaited result for every required permission.
- Provide lifecycle-safe listener cleanup and Settings-return recheck.
- Review every integration—location, notification, maps, contact, photo library, sound, realtime and external navigation—under its own privacy/effect contract.
Responsibility boundaries
| Boundary | Responsibility | Limit |
|---|---|---|
| Permission context | Build OS-specific request list, check/request multiple, expose local status. | Local status is not effective build authority. |
| Root permission setup | Request/check startup permissions and gate readiness. | Reviewed aggregate check uses asynchronous predicates incorrectly and can mark grant before results resolve. |
| AppState recheck | Recheck when app becomes active. | Permission-context listener has no reviewed removal cleanup. |
| RequestPermissions UI | Explain missing permission and offer Settings. | Copy/Settings handoff does not prove grant or restart. |
| Native declarations | Declare platform capabilities and provider integrations. | Dependencies can merge/alter effective result. |
| OS/Settings | Own prompts, blocked state and user choice. | Returning to app is not success. |
| Provider integration | Use granted capabilities for location, push, maps, contact, photo/media, sound or realtime. | Permission is not provider/API completion. |
Inputs and result
| Input/state | Client result | Failure boundary |
|---|---|---|
| OS/version | Requested list selected. | Version parsing/build declarations can diverge. |
| Check multiple | Status map stored. | Completeness requires every actual required item. |
| Request multiple | Prompt/result map stored. | Root aggregate bug can report grant prematurely. |
| Local all-granted | Map/background paths can be admitted. | Effective permission/provider trust unproven. |
| Denied/blocked | Permission UI or Settings handoff. | Settings change/restart/return separate. |
| App becomes active | Recheck requested. | Duplicate retained listener possible. |
| Integration mount | Native/provider/API work can begin. | Permission alone is not authorization or success. |
Security and privacy
- Request only permissions required for a documented purpose and active feature.
- Never log permission tokens, provider IDs, precise location, contacts, media, messages or native response payloads.
- Treat permission grant, data collection, API publication, provider use and retention as separate consents/authorizations.
- Do not expose dormant native modules or source-only routes as public features.
Limits and failure states
| State | Meaning | Maintainer response |
|---|---|---|
| Async aggregate says granted | Predicate promises were treated truthy. | Fix/await every result; no completeness claim. |
| Android 10 intended branch | Background/activity/fine/coarse is source-defined but actual selection is blocked by a version type mismatch. | Fix type-safe selection and run Android 10 positive/negative tests; do not claim the combined set. |
| AppState listener retained | Rechecks can duplicate after remount. | Add cleanup and listener-count tests. |
| Settings opened | OS owns next state. | Recheck on return; no automatic success. |
| Native declaration without JS request | Capability is packaged but not necessarily requested/used. | Keep separate. |
| Integration available | Provider can still fail or have side effects. | Use integration-specific contract. |
Troubleshooting
Diagnose requested list, declared manifest, effective built result, OS status, AppState listener count and provider/API state independently. Never use a real location, notification, call, photo or message to prove permission behavior.
Re-review whenever supported OS versions, requested lists, manifests, dependencies, startup aggregation, AppState cleanup, Settings flow or provider integration changes.
Related guides: Device permissions · Location permissions · Location validation · Background execution · Location contract · Notifications contract · Maps contract