BranchMetrics/ios-branch-deep-linking-attribution

UIActivityViewController does not show preview image and title if shareText is present

lucasdomene opened this issue · 3 comments

Xcode version: 12.5
Branch version 1.39.2

I do not get the preview image and text when I send shareText to showShareSheet(with: linkProperties, andShareText:,from:)

Screen Shot 2021-08-04 at 17 58 13

But when I send nil for that property, the preview works fine.

IMG_5876

Is that the proper behaviour or is that a bug?
I want to be able to set the share text and also have the preview configured properly.

May be this is a bug because same thing happen with me as well.

It's a confusing conflict in behavior between an older Branch feature and a newer Apple feature. We're working on fixing this in the next minor version, 1.40.0.

A potential workaround is to set a generic placeholder URL with more appropriate image and text than what the branch link has associated with it.
https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/blob/master/Branch-SDK/BranchShareLink.h#L90-L93

The 1.40.x release addresses this issue by adding support for LPLinkMetadata.
https://developer.apple.com/documentation/linkpresentation/lplinkmetadata?language=objc

This should allow you to customize that preview.
https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases/tag/1.40.0