[英]Opening another app from react-native iOS application
I tried to use Linking
from react native today in order to open mail app on ios from my one, something along the lines of 我今天尝试使用来自react native的
Linking
,以便在我的ios上的ios上打开邮件应用程序,类似
onPress={() => Linking.openURL('mail://')}
this didn't work and got me into googling spree, I got to this article but it wasn't of any help, hence my question, how can we open another apps from react-native and what is the best way to find the url bit ie mail://
for a specific app? 这行不通,让我陷入谷歌搜索狂潮,我上了这篇文章,但没有任何帮助,因此我的问题是,我们如何才能从react-native打开另一个应用程序,以及找到url的最佳方法是什么?位,即
mail://
用于特定的应用程序?
Update: using mail:
as url didn't work out either 更新:使用
mail:
as url也不可行
You're using the wrong scheme for interacting with the mail app. 您使用错误的方案与邮件应用程序进行交互。 It's supposed to be
mailto
. 应该是
mailto
。
Try something like this: 尝试这样的事情:
Linking.openURL(mailto:email@example.com)
You should also make sure the URL you're trying is supported using the Linking.canOpenURL
API. 您还应该使用
Linking.canOpenURL
API确保所尝试的URL受支持。
It's also worth mentioning that some operations won't work in the simulator but only on a real device. 还值得一提的是,某些操作仅在真实设备上无法在模拟器中进行。 Sending an email is one of these operations (another example is making a call using the
tel:
URL - will also work only on a real device). 发送电子邮件是这些操作之一 (另一个示例是使用
tel:
URL进行呼叫-也仅在真实设备上有效)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.