【发布时间】:2015-06-05 16:01:39
【问题描述】:
我在商店中已有支持深度链接的 iOS 和 Android 应用。是否可以使用 Branch.io,以便单个链接可以深度链接到取决于单击链接的操作系统的任一应用程序?
例如我使用的深层链接是 example://view/account,我想在给客户的电子邮件中使用 http://example.com/account 之类的东西
【问题讨论】:
标签: android ios deep-linking branch.io
我在商店中已有支持深度链接的 iOS 和 Android 应用。是否可以使用 Branch.io,以便单个链接可以深度链接到取决于单击链接的操作系统的任一应用程序?
例如我使用的深层链接是 example://view/account,我想在给客户的电子邮件中使用 http://example.com/account 之类的东西
【问题讨论】:
标签: android ios deep-linking branch.io
您说的完全正确,使用 Branch Links 意味着您可以生成单个链接,该链接可用于利用您现有的深层链接 URI 路径,而与单击链接的操作系统无关。
This diagram 说明了分支链接如何跨操作系统工作。
要利用您现有的深层链接路径,正确配置链接重定向的方法是在“data”/“params”字典中指定“$deeplink_path”键,并使用您指定的 URI 路径的值想附加到您在仪表板上配置的 URI 方案。
例如,您可以指定“$deeplink_path”:“radio/station/456”,我们将使用 URI“yourapp://radio/station/456?link_click_id=branch-identifier”打开应用。这里是在该示例中代码将如何查找 iOS:
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
// Customize the display of the link
[params setObject:@"Great Radio Station forKey:@"$og_title"];
[params setObject:@"url.to.picture/radiopic.png" forKey:@"$og_image_url"];
[params setObject:@"This is my jam" forKey:@"$og_description"];
// Set the deep link path
[params setObject:@"radio/station/456" forKey:@"$deeplink_path"];
Branch *branch = [Branch getInstance];
[branch getShortURLWithParams:params andCallback:^(NSString *url, NSError *error) {
// show the link to the user or share it immediately
}];
Branch 最棒的地方在于,它还允许您通过安装过程进行深度链接,通过任一应用商店传递您的 URI 路径。
如果这有帮助,请告诉我!
【讨论】: