Skip to main content

Platform Differences

This library wraps platform-native file viewers, so behavior differs between iOS and Android.

Comparison

BehavioriOSAndroid
Preview styleIn-app modal (QuickLook)External app (Intent chooser)
Promise resolutionResolves when user dismissesResolves immediately after launch
Multi-file previewSwipeable galleryNot supported
Editing/markupBuilt-in markup toolsNot supported
ThumbnailsQLThumbnailGeneratorNot supported
EventsonDismiss, onEditedFile, onSavedEditedCopyNone
Remote filesDownload to temp + previewDownload to cache + launch
Chooser titleNot applicableCustomizable via chooserTitle

iOS Details

On iOS, QLPreviewController is presented as a modal view controller. The user stays in your app and can dismiss the preview to return. This means:

  • You know when the preview is dismissed (onDismiss event)
  • You can react to edits (onEditedFile, onSavedEditedCopy)
  • The promise resolves after dismissal, so you can chain actions:
await ExpoQuickLook.previewFile({ uri: path });
// User has dismissed the preview
console.log('Preview closed');

Android Details

On Android, an Intent is fired and the system picks an app to handle it. This means:

  • Your app goes to the background
  • You don't know when the user is done viewing
  • The promise resolves right after launch
  • No events are available
await ExpoQuickLook.previewFile({ uri: path });
// Intent was launched — user may still be viewing
console.log('Intent launched');

Custom Chooser Title

On Android, customize the "Open with" dialog title:

await ExpoQuickLook.previewFile({
uri: path,
chooserTitle: 'View document with',
});

Writing Cross-Platform Code

Use Platform.OS to handle differences:

import { Platform } from 'react-native';

await ExpoQuickLook.previewFile({ uri: path });

if (Platform.OS === 'ios') {
// Preview was dismissed — safe to clean up
} else {
// Intent launched — file may still be in use
}

Use canPreview to check if a file type is supported before attempting to open it:

const supported = await ExpoQuickLook.canPreview(path);
if (!supported) {
// Show fallback UI
}