1

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

4

1 回答 1

0

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

对于 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”变量将包含这些参数。

于 2015-12-03T04:38:15.243 回答