Conversation
Add the navDeepLink routing snippet the Receiving simple data guide asks for, and carry the handler rewrite that ships with the receive.md edit.
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
bsagmoe
reviewed
Sep 14, 2026
Comment on lines
72
to
73
| val context = LocalContext.current | ||
| val intent = (context as? Activity)?.intent |
Contributor
There was a problem hiding this comment.
I think you could probably update this to use LocalActivity:
val activity = LocalActivity.current
val intent = activity?.intent
hamen
force-pushed
the
hamen/sharesheet-receive-deeplink
branch
from
September 16, 2026 15:31
8f673d3 to
5ef35f8
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.
Code snippets are for:
This lands with a
receive.mdedit, and the two have to ship together. The page edit is up on the google3 staging environment. Two of the three regions below no longer match the live page, on purpose, because the page is changing to match them.The routing snippet was written at the page owners' request. A written brief went to them naming three findings on this page: the prose contradicting its only snippet, the two-step process being incomplete because
navDeepLinkroutes but does not deliverEXTRA_STREAMorEXTRA_TEXT, and two sentences of View system text with no snippet behind them. They were offered the code following the prose or the prose following the code, and chose the first. The guide told the reader to route the incomingACTION_SENDintent with Compose Navigation's deep link support, "instead of manually intercepting and parsing the Intent", and nonavDeepLinkcode appeared anywhere on the page — the one snippet did exactly the manual interception the prose says to avoid.List of modifications:
android_receive_data_nav_deeplink: new region, the missing routing step. Tagged around thecomposable(route = "incoming_share", ...)call alone, with no exclude blocks, so the page publishes that call and nothing else. It declares three links:ACTION_SENDwithtext/plain,ACTION_SENDwithimage/*, andACTION_SEND_MULTIPLEwithimage/*. The third is there because the manifest declares that filter andSharesheetHandlerhandles it, so leaving it out would give a reader who follows steps 1 and 2 no route for multiple images.android_handle_intent_action_data_sent: edited, and no longer verbatim against the live page. It carries the rewrite that ships with thereceive.mdedit —privatehandlers,Intent.ACTION_SENDin place of the bare importedACTION_SEND,?.leton the nullable image extras, and reworded comments. 46 lines here against the page's 43.spotlessApplymoved nothing.android_handle_intent_handle_extra_text: edited, one comment. It was 6/6 verbatim and is now 5/6, because the reworded comment collapses the page's two comment lines into one. That wording ships inreceive.mdwith the rest.Snippets not migrated:
AndroidManifest.xmlactivity block with theACTION_SENDintent filters. Manifest snippets are not migrated, so it stays hardcoded on the page.One thing for the page while that manifest block is being edited: the activity declares intent filters and no
android:exported, so as printed today it will not install on API level 31 or higher. It wantsandroid:exported="true"to receive incoming share intents. That is a defect on the live page rather than a nicety.Note on overlap: this touches the same file as #1063, which removes the
ChooserTargetimport and reworkscustomTargets(). The two overlap only in the import block; whichever lands second takes a one-line conflict there.