简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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