React-Native Expo托管应用程序:如何启用共享?
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
万一其他人也有类似的问题:我要做的就是重建应用程序并将其重新安装在手机上。现在起作用。
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.