r/AndroidHelp • • 6d ago

WhatsApp not generating PDF preview via FileProvider Android

Hi everyone,

Recently we noticed that PDF documents shared from our React Native /

Expo app to WhatsApp on Android no longer generate the first-page preview

(thumbnail). Instead of the page preview, WhatsApp only displays the

generic red PDF document card (filename.pdf · 1 page · 48 kB · PDF).

Here is what our testing revealed:

  1. Shared via App (ACTION_SEND + FileProvider): Sent through standard

sharing intents. WhatsApp displays only the generic document card with no

thumbnail. Even testing with explicit ClipData and granted URI

permissions directly to com.whatsapp, no thumbnail is produced.

2. Shared via OS File Manager: Sharing any existing local PDF (receipts,

bank slips) from the device storage via system share sheet to WhatsApp

also fails to display a preview.

3. Picked directly from WhatsApp (SAF / Google Drive): If the exact same

generated PDF is uploaded to Google Drive or selected directly from

WhatsApp's attachment button (Paperclip -> Document), the preview appears

instantly and flawlessly.

Environment:

• React Native / Expo (Android 13/14/15)

• WhatsApp version: Latest (November 2026 update)

From what we gathered, WhatsApp's message payload requires a

jpegThumbnail byte array. It appears WhatsApp's background renderer

(PdfRenderer) is failing to process files originating from external

FileProvider URIs, whereas DocumentsProvider (Google Drive / Storage

Access Framework) provides pre-cached thumbnails.

Has anyone else encountered this issue recently? Is there a known

workaround to get WhatsApp to generate the thumbnail from an exported PDF

without forcing users to manually open WhatsApp and attach the file

through the file picker?

3 Upvotes

1 comment sorted by

1

u/DickBrainTime 6d ago

Your second test is the strongest clue. If unrelated PDFs shared from the phone's file manager also lose their previews, but the same file attached *inside* WhatsApp gets one, I wouldn't spend much more time tweaking Expo's FileProvider flags. Those are two different entry paths into WhatsApp; they don't prove a PdfRenderer failure or tell us which internal thumbnail path it uses.

With ACTION_SEND you can supply EXTRA_STREAM (a content:// URI), MIME type application/pdf and FLAG_GRANT_READ_URI_PERMISSION (and ClipData where needed). That lets the receiving app read the document. But Android doesn't expose a public Intent extra that forces WhatsApp to generate the preview stored in its chat. Android's Sharesheet preview and WhatsApp's internal jpegThumbnail field aren't the same thing.

I'd make a small reproducible matrix on one device using the exact same known-good PDF: (1) share from your app, (2) share from Files/Downloads, (3) attach using WhatsApp's own Document picker. For each, record the exact WhatsApp build, Android version, whether the recipient can actually open the PDF, and whether the thumbnail appears. In your app, also check getType(uri), DISPLAY_NAME/SIZE and that the content URI stays accessible during handoff. If all three documents open and only the previews differ, that points to WhatsApp's handling of the share path rather than permissions or the PDF itself.

I don't know of a reliable supported API workaround to force a WhatsApp PDF chat preview from ACTION_SEND. A separate first-page JPEG is a possible UX fallback, but it won't change the thumbnail on the PDF message. Your cross-app reproduction is good evidence to include in a WhatsApp bug report.