我认为问题出在我们的Branch.io配置中,但我无法找到它。
注意:
这是我创建链接的方式:
- (BranchUniversalObject *)generateBranchObjectFor:(MBMediaObject *)object {
NSArray<NSString *> *pathComponents = [object.shareLink pathComponents];
NSString *uid = [[pathComponents subarrayWithRange:NSMakeRange(pathComponents.count-2, 2)] componentsJoinedByString:@"/"];
BranchUniversalObject *branchObject = [[BranchUniversalObject alloc] initWithCanonicalIdentifier:uid];
branchObject.title = object.name;
branchObject.imageUrl = object.imageURL.absoluteString;
if ([object isKindOfClass:MBSong.class]) {
branchObject.contentDescription = ((MBSong *)object).artistName;
} else if ([object isKindOfClass:MBAlbum.class]) {
branchObject.contentDescription = ((MBAlbum *)object).artist.name;
}
return branchObject;
}
- (BranchLinkProperties *)generateBranchLinkPropertiesForObject:(MBMediaObject *)object channel:(NSString *)channel {
BranchLinkProperties *properties = [BranchLinkProperties new];
properties.feature = @"sharing";
properties.channel = channel;
[properties addControlParam:@"$deeplink_path" withValue:[[object.shareLink stringByReplacingOccurrencesOfString:@"http://" withString:@""] stringByReplacingOccurrencesOfString:@"https://" withString:@""]];
return properties;
}
NSString *shortURLString = [[self generateBranchObjectFor:object] getShortUrlWithLinkProperties:[self generateBranchLinkPropertiesForObject:object channel:@"twitter"]];
这是我们的链接设置:
答案 0 :(得分:3)