android - 分支 IO 深层链接自定义别名不起作用。相同的链接不在两个不同的应用程序中共享?
问题描述
我正在创建一个社交媒体类型的应用程序,其中我通过 Branch IO 的深度链接创建了一个共享配置文件。
问题:我为每个用户创建了一个唯一的用户名,并用作共享链接。示例:用户名:sumit1698 分享链接:https ://l.hire.in/sumit1698
但是,当我在创建后第一次将其共享到配置文件时,它可以工作,但是当我将相同的配置文件共享到另一个应用程序时。它显示错误
{"error":{"code":409,"message":"链接别名冲突:l.hire.in/sumit1698"}}
我在分支 IO 中使用自定义别名。
Future<void> buildBranchIOLink(ArtistModel artistModel) async {
BranchUniversalObject buo = BranchUniversalObject(
canonicalIdentifier: '${artistModel.uid}',
//canonicalUrl: '',
title: 'View my profile @${artistModel.name}',
// imageUrl: '${artistModel.profile}',
imageUrl: '',
contentDescription: 'Visit A4H app for booking',
keywords: ['Plugin', 'Branch', 'Flutter'],
// publiclyIndex: true,
locallyIndex: true,
contentMetadata: BranchContentMetaData()
..addCustomMetadata('artist_uid', '${artistModel.uid}')
// ..addCustomMetadata('artist_id', artistModel.id),
);
String username = artistModel.systemName != null
? artistModel.systemName
: artistModel.name;
BranchLinkProperties lp = BranchLinkProperties(
alias: '${username.replaceAll(" ", ".")}', //define link url,
channel: 'message',
feature: 'sharing',
stage: 'new share',
tags: ['one', 'two', 'three']);
lp.addControlParam('url', 'http://www.google.com');
lp.addControlParam('url2', 'http://flutter.dev');
BranchResponse response = await FlutterBranchSdk.showShareSheet(
buo: buo,
linkProperties: lp,
messageText: 'Hire ${artistModel.name} with A4H',
androidMessageTitle: '${artistModel.name}',
androidSharingTitle: '${artistModel.name}');
if (response.success) {
print('showShareSheet Success');
} else {
print('Error : ${response.errorCode} - ${response.errorMessage}');
}
bool success = await FlutterBranchSdk.listOnSearch(buo: buo);
print(success);
}
解决方案
推荐阅读
- python - 是否可以在 pycharm 调试器中运行预定义的脚本?
- java - Hibernate 在锁定时提交对数据库的更改?
- python - MinMaxScaler 为单个输入返回相同的值
- c# - 自动完成组合框弹出窗口的自定义样式
- visual-studio - Visual Studio 停止执行自定义构建步骤
- javascript - 在 twilio 中停止视频轨道后如何重新启动视频轨道?
- excel - Power Pivot - DAX - 显示零而不是空白不工作
- macos - 无法使用 brew 安装 boost 1.59
- amazon-web-services - AWS:将事件桥接事件转发到加密的 SQS(亚马逊托管密钥)
- html - CORS 问题:图像未在 Chrome、Edge 中显示,但在 Firefox 中有效