BranchMetrics / ios-branch-deep-linking-attribution

The Branch iOS SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://help.branch.io/developers-hub/docs/ios-sdk-overview
MIT License
729 stars 229 forks source link

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

Closed lucasdomene closed 3 years ago

lucasdomene commented 3 years ago

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.

MandeepSingh1 commented 3 years ago

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

echo-branch commented 3 years ago

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

echo-branch commented 3 years ago

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