feat(share_plus): AirDrop a link that opens the app - #3978
Open
milhomem-tshirt wants to merge 1 commit into
Open
milhomem-tshirt wants to merge 1 commit into
milhomem-tshirt wants to merge 1 commit into
Conversation
Sharing a URI through the iOS sheet currently hands AirDrop a payload the other device opens in Notes, so a super link or deep link never reaches the app. Callers can now set ShareAirDropAs.url and AirDrop receives a real NSURL. The receiving device opens that URL, which is what launches the app through the universal link or deep link. The sheet placeholder stays plain text so the header keeps the host app icon instead of a Safari page preview. Messages, Mail, and other text destinations still get ShareParams.text, which is why uri and text are allowed together only for this mode. Android has no AirDrop, so the message body wins over the bare URI in EXTRA_TEXT and the title stays EXTRA_TITLE. File captions return nil for the placeholder and for file destinations (Save to Files, AirDrop, Copy, and the rest) so they do not show up as a second item or get sent as a text file. inherit keeps the old raw-NSURL share, and the channel omits airDrop unless the caller opts in. Co-authored-by: Cursor <cursoragent@cursor.com>
milhomem-tshirt
force-pushed
the
feat/share-plus-airdrop-as-url
branch
from
September 24, 2026 00:58
521ff06 to
88f78af
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Sharing a link through the iOS share sheet does not give AirDrop something the other device can open as a URL. The payload lands in Notes, so a deep link never launches the app.
ShareParams(uri:, title:, text:, airDrop: ShareAirDropAs.url)fixes that. AirDrop receives a realNSURL. The other device opens that URL, and iOS follows the universal link or deep link into the app. Messages, Mail, and other text destinations still get the sentence intext. The sheet header stays the host app icon.ShareAirDropAs.inherit(the default) keeps today's raw-NSURLshare, including the Safari page preview. Android has no AirDrop. A titled URI already goes out asEXTRA_TEXT/EXTRA_TITLE.Why the code changes
ShareAirDropAs(inherit,url,text) is the opt-in.urlis the AirDrop-as-link path.textsends the URI string as plain text. The method channel only sendsairDropwhen it is notinherit, so existing calls stay the same.uriandtexttogether are allowed only whenairDropisurl. That split is the whole point: AirDrop gets the URL, Messages and Mail get the sentence. Every other combination still throws.SharePlusDatafor a titled URI keeps the placeholder as text, so the sheet does not switch to a Safari preview.itemForActivityType:returns theNSURLonly forUIActivityTypeAirDrop. Every other destination, including Messages and Mail, getstext(falling back to the title, then the URI).messageAndMailOnly. The placeholder and file destinations (Save to Files, AirDrop, Copy, Print, Books, Camera Roll, Markup as PDF) getnil, notNSNull, so the header stays the file and those apps do not receive a second Plain Text item. Notes and other text or multimedia extensions still get the caption.textoveruriinEXTRA_TEXTwhen both are set, so the sentence is what gets shared.titlestaysEXTRA_TITLE.textandtitlewhen a URI is paired with both. There is no AirDrop there.uri+text+airDrop: urlcall and the method-channel payload.Related Issues
None.
Checklist
CHANGELOG.mdnor the plugin version inpubspec.yamlfiles.flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
!in the title as explained in Conventional Commits).Test plan
ShareParams(uri:, text:, title:, airDrop: ShareAirDropAs.url)shows the host app icon. Messages gets the sentence. AirDrop opens the URL so the deep link launches the app.airDrop(inherit) and the share is still the raw URI with the Safari page preview.textreaches Messages, Mail, and Notes. Save to Files, AirDrop, and the sheet header stay the file only.uri+text+titleshares the sentence asEXTRA_TEXTand the title asEXTRA_TITLE.