简体   繁体   English

React Native 中针对 android 的延迟深度链接

[英]Deferred deep linking in React Native for android

Please, share your expierience in implementing deferred deep linking in React Native for android.请分享您在 React Native 中为 android 实现延迟深度链接的经验。 I've set deep linking and it works good only if user has installed app.我已经设置了深度链接,只有当用户安装了应用程序时它才能正常工作。 But if hasn't, it would be great to redirect them to Play market... And I can't figure it out how to implement such functionality.但如果没有,将它们重定向到 Play 市场会很棒......而且我无法弄清楚如何实现这样的功能。 Thanks in advance.提前致谢。

kindly add the following code in xcode and in android manifest to let your app know about your app's deep linked name, my apps deep link name is recreative请在 xcode 和 android 清单中添加以下代码,让您的应用了解您的应用的深层链接名称,我的应用深层链接名称是娱乐性的

for xcode write it in AppDelegate.m对于 xcode 将其写入 AppDelegate.m

   - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
  return [RCTLinkingManager application:application openURL:url
                      sourceApplication:sourceApplication annotation:annotation];
}

for android add it in src/main/AndroidManifest对于 android 将其添加到 src/main/AndroidManifest

<intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="recreative" 
              android:host="recreative"/>
    </intent-filter>

for more settings read this article https://reactnavigation.org/docs/deep-linking/有关更多设置,请阅读本文https://reactnavigation.org/docs/deep-linking/

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

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