You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
send text and URL as a single string separated by \n\n
avoid duplicated title/message items in the iOS URL-sharing path
Problem
On iOS, UIActivityViewController was receiving separate items for title, text,
and URL. Some targets like WhatsApp concatenate them without preserving the expected
line breaks, causing the URL to appear attached to the last line of the message.
Fix
Build a single shared text block for URL-based sharing:
text + "\n\n" + url in Share.Url
message + "\n\n" + filePath in the URL branch of Share.File
This keeps the change minimal and aligns iOS behavior with Android.
Nice fix — collapsing the separate UIActivityViewController items into a single "text\n\n url" string is the right call, and it's a faithful port of the Android path: Share.Url on Android does exactly shareText = text.isNotEmpty() ? "$text\n\n$url" : url (resources/android/ShareFunctions.kt). This should resolve the WhatsApp / line-break mashing.
One thing to address before merge, though — it doesn't fully reach Android parity:
title is dropped from the Share.Url path. Android also does putExtra(Intent.EXTRA_SUBJECT, title) (ShareFunctions.kt:41), so the title survives as the share subject. This PR sends only [shareText], so on iOS the title argument becomes a no-op — subject-aware targets like Mail lose it. The iOS equivalent of EXTRA_SUBJECT isn't a share item, it's a UIActivityItemSource implementing subjectForActivityType(_:). Restoring the title that way would make this a true parity fix rather than trading one mismatch for another.
Two smaller notes:
The URL now goes out as a plain String instead of a URL object. That's consistent with Android's text/plain, but on iOS some targets give richer link previews when they receive an actual URL item — worth a quick on-device check across Messages / Mail / WhatsApp to confirm previews still look right.
In Share.File, the shouldAppendTitle / shouldAppendMessage flags are a clean way to avoid the duplicate-item problem. Minor: the file-not-found fallback sets shouldAppendMessage = false but not shouldAppendTitle — likely intentional, just flagging for a second look.
Direction looks good; the main ask is preserving title as the activity subject so iOS matches Android's EXTRA_SUBJECT behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\n\nProblem
On iOS,
UIActivityViewControllerwas receiving separate items for title, text,and URL. Some targets like WhatsApp concatenate them without preserving the expected
line breaks, causing the URL to appear attached to the last line of the message.
Fix
Build a single shared text block for URL-based sharing:
text + "\n\n" + urlinShare.Urlmessage + "\n\n" + filePathin the URL branch ofShare.FileThis keeps the change minimal and aligns iOS behavior with Android.