【问题标题】:Creating Branch.io dynamic URLs to pass and fetch params in deep linking创建 Branch.io 动态 URL 以在深度链接中传递和获取参数
【发布时间】:2015-11-30 13:41:07
【问题描述】:

如果未使用 Branch.io 仪表板设置安装应用,我可以将用户重定向到网页 (www.example.com)。但在我的情况下,我在 URL 方案或后备中编写的 URL 需要是动态的,并且将包含用户的一些信息,在应用程序中打开哪个页面等作为参数。我可以在仪表板中创建带有参数的链接,但是如何在我的应用程序中检索这些参数?

【问题讨论】:

    标签: android ios deep-linking branch.io


    【解决方案1】:

    Branch 的 SDK 需要集成到您的应用中。您看到的回调 here(等待您正确设置所有其他内容)将传递您添加到您创建的链接的那些参数。

    对于 iOS,您需要执行以下操作:

    Branch *branch = [Branch getInstance];
    [branch initSessionWithLaunchOptions:launchOptions andRegisterDeepLinkHandler:^(NSDictionary *params, NSError *error) {
        if (!error) {
            // params are the deep linked params associated with the link that the user clicked -> was re-directed to this app
            NSLog(@"params: %@", params.description);
        }
    }];
    

    上面的“params”变量将包含这些参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-18
      • 2018-10-23
      • 1970-01-01
      • 2021-12-12
      • 2019-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多