React native 当应用程序已安装时,如何在React Native中从实际应用程序打开应用程序?

React native 当应用程序已安装时,如何在React Native中从实际应用程序打开应用程序?,react-native,react-native-android,react-native-ios,react-native-linking,React Native,React Native Android,React Native Ios,React Native Linking,我使用库进行深度链接是我的React本机应用程序(仅涉及IOS) 如果应用程序未安装,它将成功打开苹果商店 但问题是,即使安装了该应用程序,它也会用open按钮打开apple商店 这是我的密码 AppLink.maybeOpenURL('my apple store app', { appName: 'xxxxx', appStoreId: 'xxxxxx', appStoreLocale: 'xxxxxx', playStoreId: undefined }).then(() => {

我使用库进行深度链接是我的React本机应用程序(仅涉及IOS)

如果应用程序未安装,它将成功打开
苹果商店

但问题是,即使安装了该应用程序,它也会用
open
按钮打开
apple商店

这是我的密码

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))

这回答了你的问题吗@EthanHill感谢您花时间回答,但遗憾的是,此库建议,如果安装了应用程序,它将打开它,但如果您在应用程序中有指向特定页面的链接,例如,您可以使用
Linking
from
react native
将链接添加到按钮,例如
onPress={()=>Linking.openURL(myUrl)}
并且如果设备上存在应用程序,它将自动打开该应用程序。与我的问题中描述的行为相同。