Universal链接不适用于React Native

问题描述 投票:0回答:1

我已经成功使用React Native&Branch.io一段时间了,很棒。但是,我也希望能够处理非分支深层链接。例如,如果我的域名是https://example.com,则我想在打开https://example.com/my-items时打开我的应用程序。我一直在尝试使其运气不佳。我读了很多很多GitHub问题和SO问题。要重复一遍,https://example.app.link(即分支网址/通用链接)可以正常工作。

基本上,当我单击https://example.com/my-items时,我的网站在Safari中打开。未显示“使用XYZ打开” iOS模式,并且我也没有进入该应用程序。

这是我已经尝试过的:

0)通过https://facebook.github.io/react-native/docs/linkinghttps://hackernoon.com/react-native-deep-linking-for-ios-and-android-d33abfba7ef3

1)确保我将https://example.com/apple-app-site-association(并通过https://branch.io/resources/aasa-validator/验证)作为JSON并可以公开使用。

2)XCode -> Capabilities -> Associated domains

2.1)我还尝试了与d相关联的app.link。>

3)为了调试,我什至在AppDelegate.m中进行了以下操作(通常我通过[RCTLinkingManager application:application openURL:url options:options]等进行检查)

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  return YES;
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
 restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
  return YES;
}

4)我在设备本身上尝试过(使用iMessages,Notes,Safari)。我还关闭了远程调试(如here所示)

相关版本:

XCode:版本10.2.1(10E1001)

iOS:12.4.1

本机:0.60.5

react-native-branch:3.0.0 ^

https://example.com/apple-app-site-association

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "<MyTeamID-censored>.<My-Bundle-Identifier-censored>", 
        "paths": [
          "/verify-email*",
          "/notifications/borrower-request*",
          "/notifications/request-confirmed*",
          "/messages/*",
          "/verification",
          "/my-items",
          "/my-rentals",
          "/dashboard*"
        ]
      }
    ]
  }
}

我已经成功使用React Native&Branch.io一段时间了,很棒。但是,我也希望能够处理非分支深层链接。例如,如果我的域名是https:// ...

react-native react-native-ios branch.io ios-universal-links
1个回答
0
投票

这与您的用例有关吗?它帮助了我。

© www.soinside.com 2019 - 2024. All rights reserved.