Skip to content

fix(android): open attachments directly with default viewer app instead of share sheet #32

Description

@arnauda-gh

Description

When tapping an email attachment (or file in Files view) on Android, the application opened the system Share sheet ("Partager avec...") instead of opening the file directly in a default viewer application (such as PDF Viewer, Gallery, Video Player, or Document Viewer).

Root Cause

shareAttachment in src/lib/email-export.ts called Sharing.shareAsync.

  • On iOS, Sharing.shareAsync opens QuickLook preview directly.
  • On Android, Sharing.shareAsync opens Intent.ACTION_SEND (Share sheet), asking where to share/send the file instead of viewing it.

Fix

On Android, shareAttachment now converts the file URI to a content:// URI using FileSystemLegacy.getContentUriAsync and launches android.intent.action.VIEW via expo-intent-launcher. If no viewer app handles the file format on the device, it falls back gracefully to Sharing.shareAsync.

Metadata

Metadata

Assignees

No one assigned

    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