Skip to content

"Grant Permission" in the recent-media strip does nothing once iOS has been denied #29

Description

@Bielcx

Symptom

On the create-post screen, the "Grant Permission" button in the recent-media strip
does nothing when tapped — no dialog, no state change.

Reported alongside a fair question: why does "add media" list every photo even
without that permission?

Root cause

components/ui/RecentMediaGallery.tsx:36-46:

const requestPermission = useCallback(async () => {
  const { status } = await MediaLibrary.requestPermissionsAsync();
  setHasPermission(status === "granted");
  return status === "granted";
}, []);

canAskAgain is ignored. iOS shows the permission dialog once; after a denial,
requestPermissionsAsync() returns denied immediately without presenting any UI.
So the button re-runs a call that can no longer prompt, and nothing visible happens.

Once canAskAgain is false the only path is the Settings app — which the map screen
already tells users to do when location is denied
(app/(tabs)/map.tsx:224).

Why "add media" works without permission

Two different mechanisms, not an inconsistency in the permission state:

  • Add mediaImagePicker.launchImageLibraryAsync()
    (app/(tabs)/create.tsx:162). On iOS 14+ this is the system picker, running out
    of process. The user picks, and only the chosen asset is handed to the app.
    It requires no permission at all.
  • Recent media stripMediaLibrary.getAssetsAsync(), which enumerates the
    library from inside the app and therefore does need full access.

Suggested fix

Detect canAskAgain === false and send the user to Settings via
Linking.openSettings(), keeping the in-app request for the first-run case.

Worth deciding first

The recent-media strip is the only reason this app asks for library access at all —
the system picker covers selecting media without it. If the strip isn't pulling its
weight, removing it would delete a permission prompt, a failure state and this bug
in one go. Product call, worth making before implementing.

Suggested label: bug, mobile

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions