React-Native Expo托管应用程序:如何启用共享?

发布于 2025-02-13 04:49:33 字数 521 浏览 1 评论 0原文

我正在使用Expo SDKv。45,iPhone 13 Pro(iosv。15.5),Expo-Sharingv。10.1.1。

我目前正在使用expo start -dev-client在iPhone上测试我的应用程序。我需要能够与外界共享应用程序内部创建的文件。我发现实现这一目标的博览会共享。不幸的是,当我跑步时,

install * as Sharing from 'expo-sharing';

...

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

我会获得“不可用”。

我该怎么做才能获取我的应用程序允许共享?我在博览会文档中找不到任何东西。

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铜锣湾横着走 2025-02-20 04:49:33

万一其他人也有类似的问题:我要做的就是重建应用程序并将其重新安装在手机上。现在起作用。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文