androidiosfirebasefirebase-dynamic-linksdynamic-links

How to go directly to the App Store by clicking on the dynamic link when the user has not installed the application?


Currently, Dynamic Link is used normally in the React-native app. However, the Dynamic Link is not redirected to the app-store when the user has not installed the app.

createShortDynamicLink(contentKey, title, subtitle, youTubeVideoId) {
  const dynamicLinkDomain = __DEV__
    ? 'test.page.link'
    : 'test.page.link';

  const link =
    new firebase.links.DynamicLink(`https://test.com/contents/${contentKey}`, dynamicLinkDomain)
      .social.setImageUrl(`https://img.youtube.com/vi/${youTubeVideoId}/hqdefault.jpg`) // make size over 200*200
      .social.setDescriptionText(subtitle)
      .social.setTitle(title)
      .android.setPackageName(DeviceInfo.getBundleId())
      .ios.setBundleId(DeviceInfo.getBundleId());

  return firebase.links()
    .createShortDynamicLink(link, 'UNGUESSABLE');
}

https://firebase.google.com/docs/dynamic-links/use-cases/web-to-app https://rnfirebase.io/docs/v5.x.x/links/reference/SocialParameters I used this docs..


Solution

  • You need to set fallback links. You can find more options about properties in official page.