вот код, который я использую для создания динамическая ссылка-
Код: Выделить всё
private func generateShareProductDynamicLinkeURL() {
let buo: BranchUniversalObject = BranchUniversalObject()
buo.canonicalIdentifier = "/product/\(productDetailsVM.productDetails?.id ?? "")"
buo.title = productDetailsVM.productDetails?.name ?? ""
buo.contentDescription = productDetailsVM.productDetails?.description
buo.imageUrl = productDetailsVM.productDetails?.imageUrl ?? ""
buo.contentMetadata.contentSchema = .commerceProduct
buo.publiclyIndex = true
buo.contentMetadata.customMetadata["shareProduct"] = productDetailsVM.productDetails?.id ?? ""
let blp: BranchLinkProperties = BranchLinkProperties()
blp.channel = "whatsapp"
blp.feature = "Product Sharing"
buo.getShortUrl(with: blp) { url, error in
productDetailsVM.isLoading = false
if let url = URL(string: url ?? "") {
shareProductDetails(url)
} else {
print("ERROR: while creating dynamic link - \(String(describing: error))")
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... amic-links