Sharing into the app#
Another app's Share offers TaskFest (#279): text, a link, an image or a PDF shared to it opens
Add a task, filled in, to be finished there — a due date chosen, at least. Android has it
(#355), and iOS through a share extension (#356). Why expo-sharing, and why the app reads only
the raw share, is in decisions/mobile-app.md.
What is offered#
- Android offers TaskFest for text and links, and for images and PDFs: one, or several at
once (
app.config.ts). A file of another type is not offered TaskFest at all. - iOS offers it the same way, through a share extension: a small second app inside
TaskFest that
expo-sharing's plugin generates. Its rule says which shares it is offered for, by type (mobile/src/shareExtension.ts): those whose every item is an image, a PDF, a link or text — a link or text that is not a file, so a.txtfrom the Files app is not offered. (Android offers it, as text, and the form then says the file's type is not taken.) - Android's share sheet says what it does: Create Task — Create Task (QA) and Create
Task (Dev) in the other builds, so that two installed side by side can be told apart
(
mobile/src/variants.ts). It is the label of the shares the app is offered for (mobile/plugins/withShareLabel.ts), which the share sheet shows beneath the app's name, as it shows Maps' Add to …. - iOS's share sheet shows the app: TaskFest's icon and name — TaskFest, TaskFest QA,
TaskFest Dev — in the row of apps, not the extension's own name: iOS 26 and 27 name every
share extension there by its app. It is the row of icons, not the Actions list beneath it:
that list is for action extensions, a different kind, which TaskFest does not have. A newly
installed app may sit at the end of the row, or behind More. The extension is still called
Create Task (
mobile/plugins/withShareExtensionName.ts), where the plugin would call it "expo-sharing-extension", in case another iOS version or screen shows it.
How a share reaches the app#
- On Android the share starts the app, or reaches it running, as an intent; files come as links the app may read for as long as it runs, and are copied at once.
- On iOS the extension runs on its own, in the sending app's share sheet. It copies the files
into an App Group — a folder TaskFest and its extension share,
group.<bundle id>— each into a folder of its own, so two files of one name both arrive (expo-sharing does so since SDK 58; before,mobile/plugins/withShareExtensionName.tshad to) — notes the share there, and opens TaskFest by its URL scheme. Apple offers an extension no public way to open its app; the one used here is the one every such library uses, and App Review may object to it. If it does, the fallback is an extension of the project's own, not built yet, that keeps the share and says "Saved. Open TaskFest to finish it.": the app's side would stay the same, since it looks for a share whenever it becomes active (decisions/mobile-app.md). - The App Group must be known to Apple, for the app and the extension, and both must be signed with it: distribution.md has the steps, and the check that a release keeps it.
What a share becomes#
mobile/src/incoming.ts turns a share into a task to add:
- Text is the description, cut to the 255 characters the backend takes
(
TaskCreateRequest'smaxLength, which a test compares). - A link becomes a link on the task (#414), not part of the description: it waits in the form, listed with × like a picked file, and is added once the task exists, counted with the files against what a task holds. The page's title, where the sharing app gives one, arrives as text beside the link, so it is both the description and the link's title; a link shared alone leaves the description empty and is listed by its address. Nothing requests the link, so there is no preview of the page.
- Safari hands the title to the extension in the item's attributed content text, which
expo-sharing's template ignores;
withPageTitle(mobile/src/shareExtension.ts) patches the template to pass it on. - Chrome on Android sends the title as the share's subject (
Intent.EXTRA_SUBJECT), which expo-sharing drops;mobile/patches/expo-sharing+<version>.patchpasses it on, applied bypatch-packageon everynpm ci. Expo ships expo-sharing for Android precompiled, sopackage.jsonhas it built from that patched source (expo.autolinking.android.buildFromSource);src/patches.test.tsfails if either is missing. - Text with a link inside it, as many apps share — "Read the article https://…" — stays text, as before: only a share that is a link becomes one.
- Files are copied into the app's cache, under
shared/, and go up as soon as the form opens, to its draft, as picked files do (files.md): by the time the form is filled in, they are there, and Add only adds the task (#381). - A file the backend would refuse is refused at once, by the website's rule and in its words —
one the sending app says is too large without being copied first, and a type the backend
takes is preferred to another spelling of it (
image/jpgof aphoto.jpg). - A file that cannot be described or copied — its permission withdrawn, a damaged photo — is said to be unreadable, and the rest of the share stays.
- A task takes two: of more, the first two are kept, and the form says which were left out.
- An iPhone's HEIC photo becomes a JPEG.
- A file's name is the end of its link. Where that says the type —
Rechnung.pdf— it is kept; otherwise the file is named by its type,shared.png. Android's Files app shares links that end in a document's number, so its files arrive asshared.pngand the like.
When the form opens#
TaskFestApp takes a share when the app starts and whenever it comes back to the foreground, and
opens the form once the board can take it. Until its form is closed, the share stays where the
platform keeps it (#432, sharesFrom in mobile/src/incoming.ts): it is read but not cleared, and
the files the iOS extension left are not let go, so an app the system ends meanwhile — while the
user signs in, or is off in another app for a password with the form open — finds it again when it
next starts. It is taken once a run, however often the app comes back meanwhile, and cleared once
its form is closed — added, cancelled, or closed by a sign-out — unless a newer share has replaced
it there. A share replaced there before its form ever opened, in a run that then ended, leaves its
files in the App Group: nothing names them any more. The platform keeps one share, so a share waiting behind another lives
only as long as the run. On Android the share is the intent that started the app, held in memory:
whether Android hands it over again to an app it ended depends on how the user comes back to it.
- Signed out, it waits for the sign-in.
- Over the board kept on the phone, which takes no change (board.md), it waits until the current board is there.
- Over a form, the account sheet or an open image, it waits until they are closed, so nothing typed is lost.
- Behind another share: shares wait in turn, none replacing another. Each opens a form of its own, so nothing typed into the last one carries over.
The copies go once the form is closed — added, cancelled, or closed by a sign-out — and none of
its files is uploading any more; copies the form does not keep go at once; and copies a run left
behind go before the next run's first share. On iOS the extension's own copies, in the App Group,
go when the share's form is closed, with their folders (releaseShared in Main.tsx).
Tested#
incoming.test.ts: what a share becomes, names and refusals included; and that it stays with the platform until its form is closed (#432).TaskFestApp.sharing.test.tsx: when the form opens, when the copies go, and when the share is let go where the platform keeps it.- Mobile CI's
boardshare (mobile/maestro/share/): text sent to the app as another app sends it, and an image through the Files app's real share sheet, each added to the board. - Mobile CI's iOS build: the extension's name, its App Group, its rule evaluated against shares
of each kind, and both signed with the App Group as a release signs them
(
.github/scripts/check-share-extension.py,check-share-activation.swift,sign-with-app-group.sh). - Mobile CI's iOS share (
mobile/maestro/ios/, #380): that signed build on an iPhone 18 Pro simulator with the newest iOS on GitHub'sxcode-27image (#658): the Safari flow taps by that screen, and the image's first iPhone, the iPhone Duo, puts Safari's buttons at the side. A photo shared from Photos and a page from Safari, each through the real share sheet, where TaskFest Dev must be offered and must open the app; the simulator's iOS asks first, and the flows let it. In Safari's sheet TaskFest Dev is tapped by its place on the screen, not by its name: the sheet is a scene of its own, Maestro reads its elements' places relative to it, and a tap by name landed above the sheet, which Safari took for a cancel (#395). No stack runs on the macOS runner, so it ends at the sign-in: whether the photo was kept is not checked there, and the way on to the board is the Android flows'. Its screenshots, Maestro's debug output and the simulator's log for the share are themaestro-output-iosartifact. It fails Mobile CI; for a while it did not (#401), because it failed often enough that a red run said nothing. The failures were the simulator's, before any of TaskFest's code: Photos now and then never finishes preparing the photo, so iOS never starts the extension, and a tap on Open while iOS's question was still coming in went nowhere. The photo's flow shares it again, once, from a restarted Photos when nothing has happened after 90 s, and taps Open again while the question is still there. Maestro's own driver failed too, three times in nineteen runs and never in the share: on the freshly booted simulator it started too slowly, or went away mid-tap. It now has 300 s to start, andrun-on-simulator.shruns the flow once more whendriver-failed.shfinds the driver, not the flow, failed, or (#533, below) Photos stalled; any other failure fails at once. Each run's console output is in the artifact. With that, ten re-runs ofmain's run for #416 all passed, none needing the driver's second run. Those numbers are the photo's. The Safari share is younger and less proven: its own stumbles were the simulator's too -- a tap on Safari's first-run tip or on the menu's Share that came while it was still opening and went nowhere -- and it now taps again while either is still there. Its final version passed in all three runs on #464, which is few. Three more of the simulator's stumbles followed (#473). The first share of a photo once came through late, after Photos had been restarted for the second, and its question stood in the way: a question still there after the restart is now answered, as one on time would be, since the extension has taken the photo and is opening the app, and the photo is not shared again. TaskFest's extension stalled in Safari too, at its compose view (Cancel / Post), or never started, and handed nothing over in 90 s: the Safari flow now shares again, once, from a restarted Safari, the way the photo's does. A question that comes late there is turned down rather than answered, because a photo's late share asks the same, and only the new share may pass the flow; a late share that reached the app's sign-in is not shared again. And a tap on Open hung in Maestro's XCTest runner for nearly three minutes while the app it opened was starting; the runner gave the request up and Maestro failed with an error of no name, which its report calls Unknown error.driver-failed.shcounts that as the driver's only when Maestro's log says a tap failed at most a minute after the runner's log says it gave a request up, so the flow runs once more; an unknown error alone, or one long after a request the runner got over, still fails at once. The tap on Open also lets the question be gone by the time it looks. Either flow still fails at once when TaskFest Dev is not offered, and when the app never opens: after the second share, or, for the photo, after a late first share whose question was answered instead. The next stumbles had one cause (#500): on the freshly booted simulator a process's first start may take over a minute, Safari's share sheet stayed blank 41 s and the app once took 82 s to come up. The Safari flow waits up to 120 s for its share sheet, and both up to 150 s for the sign-in;run-on-simulator.shstarts the app until its sign-in shows and Photos until its grid does before the shares (warm-up-app.yaml,warm-up-photos.yaml), and logs Photos' daemons, whose hangs are still unexplained, from the warm-ups on. A second run of the photo's flow taps a photo only when Photos is not already showing one, as iOS may reopen it there. Two stalls of the simulator's iOS stayed (#533), onmainamong others. Safari's menu now and then did not open on the first tap on More, so its Share was not found: More is tapped again while Share is not there. And Photos still showed Preparing… after the flow's restart and second share: the photo's flow then fails on that by name, before TaskFest's extension has started, andrun-on-simulator.shruns it once more, as after a driver failure, whenshare-stalled.shfinds that in the final failure. The extension not opening the app, in either flow, and TaskFest Dev not offered still fail at once. Maestro's XCTest runner also, while Safari was in the foreground, found no app there and handed Maestro the home screen's elements instead, logging No foreground app found returning springboard app hierarchy, so the Safari flow waited in vain for the toolbar on its screenshot (#699): four of five runs of #698 failed on the share flows, on a change that did not touch the app.driver-failed.shcounts that as the driver's when the check for Safari's toolbar, before anything is shared, failed at most 30 s after the runner last said so, and the flow runs once more. A green run ofmainhad said so too, and got over it; and an app that crashed after a share leaves the home screen in front as well, so any other check still fails at once. Still tried by hand, on TestFlight: text shared on an iPhone, and a share taken on to the board signed in.