React-native:链接/深度链接-在AppStore中打开应用程序主页

时间:2020-09-11 21:16:52

标签: react-native app-store deep-linking

我正在尝试在AppStore / Play商店中打开此应用。

this constructor

我找不到此应用程序的深层链接URL。因此,我决定在App Store / Play商店中打开应用程序的主页。

我可以使用以下代码在Play商店中打开

let  GOOGLE_APP_ID = 'ca.gc.hcsc.canada.stopcovid';
let googleAppDeepLinkURL ='https://play.google.com/store/apps/details?id=ca.gc.hcsc.canada.stopcovid';

     if (Platform.OS === 'android') {
  Linking.canOpenURL(googleAppDeepLinkURL).then((s) => {
    Linking.openURL(`market://details?id=${GOOGLE_APP_ID}`).catch((err) =>
      Linking.openURL(
        `http://play.google.com/store/apps/details?id=${GOOGLE_APP_ID}`,
      ).catch((err) => console.error('An error occurred', err)),
    );
  });
}

如何通过iPhone在App Store中打开应用页面?

0 个答案:

没有答案