简体   繁体   English

如何使用 react-native-version-check 打开 App Store 而不是 iTunes store

[英]How to open App Store instead of iTunes store with react-native-version-check

I am using react-native-version-check to open app store/play store if update is available, but on iOS it open iTunes store, I want to open AppStore.如果更新可用,我正在使用 react-native-version-check 打开应用商店/Play 商店,但在 iOS 上它打开 iTunes 商店,我想打开 AppStore。
This is my code:这是我的代码:

 _onPressUpdate = async () => { Linking.openURL(await VersionCheck.getStoreUrl({ignoreErrors: false, appID: "407690035", appName: "hotel-tonight-last-minute", packageName: "com.hoteltonight.android.prod"})); } // this appID and appName is just from some random app on the app store for testing

To open app store inside from react native app.从本机应用程序打开应用程序商店。 Go to google search your app on appstore copy that url去谷歌搜索你的应用程序在应用程序商店复制该网址

Your app should be live on appstore to generate the link您的应用应该在应用商店上线以生成链接

 const url = Platform.OS === 'android' ?
                    'https://play.google.com/store/apps/details?id=YOUR_APP_ID'   :  'https://apps.apple.com/us/app/doorhub-driver/id_YOUR_APP_ID'
                Linking.openURL(url)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM