0

目前,动态链接在 React-native 应用程序中正常使用。但是,当用户尚未安装应用程序时,动态链接不会重定向到应用程序商店。

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.xx/links/reference/SocialParameters 我使用了这个文档..

4

1 回答 1

0

您需要设置后备链接。您可以在官方页面中找到有关属性的更多选项。

于 2019-01-21T06:09:41.920 回答