最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swiftui - iOS - Image is not visible on branch.io dynamic links - Stack Overflow

programmeradmin2浏览0评论

I am trying to create a dynamic link with branch io. everything is working fine the dynamic link is created successfully but the thumbnail image is not visible on the link even after adding the image url in BranchUniversalObject.

here is the code that i am using for creating dynamic link-

    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 = merceProduct
        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))")
            }
        }
    }

The image url is not nil. i have checked it already.

I am trying to create a dynamic link with branch io. everything is working fine the dynamic link is created successfully but the thumbnail image is not visible on the link even after adding the image url in BranchUniversalObject.

here is the code that i am using for creating dynamic link-

    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 = merceProduct
        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))")
            }
        }
    }

The image url is not nil. i have checked it already.

Share Improve this question edited Nov 23, 2024 at 16:14 Employed Russian 215k36 gold badges321 silver badges389 bronze badges asked Nov 19, 2024 at 14:02 Ayan AnsariAyan Ansari 776 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

This started happening to us recently after working for many years. Judging from this page it's possible that they stealthily made this no longer work unless you have a special enterprise contract.

Please note that the $og_image_url social preview feature is reserved for paid Branch accounts with a dedicated contract. If you do not have a paid Branch account, you will not see this feature in the Branch Dashboard.

This FAQ page was "Updated about 1 month ago", and the other FAQ pages were updated 3 years ago.

The only way we can customize it now is by specifying a $fallback_url that already has the desired og_image_url in its metadata, which isn't always ideal.

As pointed out by Michael Tom, this is no longer a feature for the free tier of Branch (as of October 17, 2024).

I reached out to Branch support and this was their response:

Customers not on our Enterprise plans can no longer customize Social Media tags when creating links. You can refer to the following article for details: Can I change my app icon?

发布评论

评论列表(0)

  1. 暂无评论