expo-sharingallows you to share files directly with other compatible applications.
|Android Device||Android Emulator||iOS Device||iOS Simulator||Web|
expo-sharingfor web is built on top of the Web Share API, which still has very limited browser support. Be sure to check that the API can be used before calling it by using
expo start --httpsto enable it.
expo-sharingonly supports sharing from your app to other apps and you cannot register to your app to have content shared to it through the native share dialog on native platforms. You can read more in the related feature request. If you are using the bare workflow you can build this functionality on your own, but it is not available in the managed workflow.
expo install expo-sharing
import * as Sharing from 'expo-sharing';
Determine if the sharing API can be used in this app.
A promise that fulfills with
true if the sharing API can be used, and
string) - Local file URL to share.
SharingOptions) - A map of share options.
Opens action sheet to share file to different applications which can handle this type of file.