Skip to main content

01 - Permission

1. Why​

Asking for a runtime permission (camera, location, notifications, photos) has more outcomes than "yes" or "no". A user who denies twice on Android, or once on iOS, can't be asked again: the app must explain and send them to the system settings. A checker that returns only a Boolean can't tell the UI which of those situations it's in. Every app then rewrites the same branching, usually wrong.

sinew_permission gives one checker with a status that names every outcome the UI has to handle.

2. Shape​

StatusMeaningThe UI should
Grantedallowedproceed
Deniednot allowed yet, and the app may askshow why, then request
PermanentlyDeniedthe system won't show the prompt againexplain, then offer to open settings
Restrictedthe user can't grant it (parental controls, a managed device)explain that the feature is unavailable
Limitedpartly allowed (iOS: selected photos only, approximate location)work with what's allowed, offer to widen
RuleWhy
Ask only at the moment the feature is used, after explaining whyPrompts out of context get denied, and a denial can be permanent
Re-check the status when the app returns to the foregroundThe user may have changed it in settings
Permissions are an app concern: the checker never decides what a feature does without oneSinew provides the mechanism, the product decides the fallback

3. API​

NameSignature (pseudocode)
Permissionenum { Camera, Photos, Location, LocationAlways, Notifications, Microphone, Contacts, … }
PermissionStatusGranted | Denied | PermanentlyDenied | Restricted | Limited
PermissionCheckerstatus(permission): PermissionStatus, request(permission): PermissionStatus, request(permissions): Map<Permission, PermissionStatus>, openSettings()
PermissionChecker.createthe platform implementation

4. Open questions​

None left. Settled in review (2026-10-02):

  • First version: camera, photos, location, notifications, microphone.
  • Notifications on Android 12 and older report Granted, because they're granted at install.
  • Wrap an existing plugin or write it directly: decided when the package moves out of Later.