John
John

Reputation: 527

React-Native Expo Managed App: How do I enable sharing?

I'm using Expo SDK v. 45, iPhone 13 Pro (iOS v. 15.5), expo-sharing v. 10.1.1.

I'm currently using expo start --dev-client to test my app on my iPhone. I need to be able to share a file, created inside the app, with the outside world. I found expo-sharing to achieve this. Unfortunately, when I run

install * as Sharing from 'expo-sharing';

...

useEffect( async () => {
  const canShare = await Sharing.isAvailableAsync();
  if (canShare) {
    console.log("available");
  } else {
    console.log("Not available");
  }
}, []);

I get 'Not available'.

What must I do to get my app to allow sharing? I can't find anything in the Expo documentation.

Thank you.

Upvotes: 0

Views: 561

Answers (1)

John
John

Reputation: 527

In case anybody else has a similar issue: all I had to do was rebuild the app and reinstall it on my phone. Now it works.

Upvotes: 1

Related Questions