【发布时间】:2020-08-05 12:43:29
【问题描述】:
请分享您在 React Native for android 中实现延迟深度链接的经验。 我已经设置了深度链接,只有当用户安装了应用程序时它才能正常工作。但如果没有,将它们重定向到 Play 市场会很棒......而且我无法弄清楚如何实现这样的功能。 提前致谢。
【问题讨论】:
标签: android react-native deep-linking
请分享您在 React Native for android 中实现延迟深度链接的经验。 我已经设置了深度链接,只有当用户安装了应用程序时它才能正常工作。但如果没有,将它们重定向到 Play 市场会很棒......而且我无法弄清楚如何实现这样的功能。 提前致谢。
【问题讨论】:
标签: android react-native deep-linking
请在 xcode 和 android manifest 中添加以下代码,让您的应用知道您的应用的深层链接名称,我的应用深层链接名称是娱乐性的
对于 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];
}
对于 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>
更多设置请阅读这篇文章 https://reactnavigation.org/docs/deep-linking/
【讨论】: