简体   繁体   English

从本机iOS应用程序打开另一个应用程序

[英]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.

相关问题 是否可以将参数从一个 react-native 应用程序转移到另一个 react-native 应用程序? - Is it possible to transfer parameter's from one react-native application to another react-native application? 从 React-Native 应用程序中的另一个类访问静态变量? - Access static variable from another class in React-Native app? 为iOS构建应用程序(本机) - Build app for ios (react-native) 在 react-native 应用程序中渲染另一个屏幕 - Rendering another screen in react-native app 如何在IOS中从我的React-Native应用程序打开外部应用程序? - How can I open a external App from my React-Native App in IOS? 如何从 React Native 应用程序迁移到 react-native 模块 - How to migrate from React Native app to a react-native module 将react-native侧面菜单添加到我的应用程序(通过react-native元素)-应用程序在启动时崩溃 - Adding react-native side menu to my application (from react-native elements) - application crashes on launching 如何在真实设备上捆绑和部署React-Native iOS应用 - How to bundle and deploy React-Native iOS app on real device 拍照时 React-native iOS 应用程序崩溃 - React-native iOS app crashes when taking picture 如何修复IOS设备上的应用程序崩溃 - How to fix app crashing on IOS devices react-native
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM