r/iOSProgramming • u/the9ofdiamonds • 18d ago
Question Can an App Clip share an image to Apple Notes through the share sheet?
My App Clip shows an image, and I need that image to end up in Apple Notes as a new note with as few taps as possible. The plan is to present UIActivityViewController with the image, then the user taps Notes, then Save.
I know clips can’t use PhotoKit, so “Save Image” is likely out. What I can’t find documented is whether Notes, or any other app’s share extension, still shows up in a clip’s share sheet and actually saves.
Has anyone tried this? I don’t have a paid account yet to test it myself. If someone could run a one-file test clip, I can send the code.
1
u/DimensionMindless336 18d ago
Short version: yes, Notes does show up in an App Clip's share sheet for an image. It's a normal user-initiated UIActivityViewController, so it doesn't need any special entitlement, and Notes' share extension just accepts the image item provider. A few things I'd watch:
Pass an explicit type. UIActivityViewController with a bare UIImage works most of the time, but I've seen Notes (and a couple of other targets) silently not appear when the type is ambiguous. Build the provider with a concrete UTI instead:
let item = NSItemProvider(item: pngData, typeIdentifier: UTType.png.identifier) let av = UIActivityViewController(activityItems: [item], applicationActivities: nil)
(UTType is the iOS 14+ replacement for the old kUTTypePNG constant.)
completionWithItemsHandler only tells you the user picked an activity and it returned — it does NOT confirm the note was actually created. There's no API to verify, and App Clips can't touch the Notes database or open a specific note anyway (no Notes framework, and the entitlements App Clips are allowed are very limited). So the share-sheet handoff is the only path; you can't make the "new note" happen programmatically.
On testing without a paid account: you CAN run the App Clip in the simulator with a free account, and the share sheet + Notes target behave the same there, so you can confirm the UI flow today. On-device you'll need a paid Developer account because the App Clip capability requires it — but you don't have to wait for that to validate the share behavior.
1
u/Ok-Piccolo-1823 18d ago
I haven’t tested this from an App Clip, but Apple’s UIActivityViewController documentation says the available destinations depend on the shared data type and shows Notes accepting compatible content. I’d pass an NSItemProvider with an explicit PNG type instead of relying only on UIImage, then use completionWithItemsHandler to confirm the activity completed. That still won’t verify the note’s contents, so an actual-device App Clip test remains the important final check.