我正在使用 this用于深度链接的库是我的 React Native 应用程序(仅关注 IOS)
如果应用程序未安装,它会成功打开 apple store
。
但问题是即使安装了该应用程序,它也会使用 open
按钮打开 apple store
。
这是我的代码
AppLink.maybeOpenURL('my apple store app', { appName: 'xxxxx', appStoreId: 'xxxxxx', appStoreLocale: 'xxxxxx', playStoreId: undefined }).then(() => {
// do stuff
})
.catch((err) => {
// handle error
});
我做错了什么吗?
最佳答案
可以通过链接完成。
import {Linking} from 'react-native';
如果你想打开任何输入它的 url 就像如果你想打开 facebook 可以这样做:
Linking.openURL(`fb://profile/${pageId}`)
.catch(err => console.error('An error occurred', err))
关于react-native - 当应用程序已经安装时,如何从 React Native 中的实际应用程序打开应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62661281/
相关文章:
google-apps-script - 如何使用 GAS 获取文档中的 URL 并将其替换为 UR
javascript - 如何使用 Cypress 将变量的存储值获取到 URL 命令中?
python - 如何使用 OpenCV 网络摄像头视频和其他 wx 组件(在同一框架/面板内)创建
angular - 具有父/子关系的 Angular 组件中的通用类型定义
python-3.x - Python中存在数值数据时如何解决TypeError : 'No Num
reactjs - 在 cookie 接受横幅后重新初始化 i18next 实例
python - 线程 Tornado + flask 应用程序的正确方法是什么?