Skip to content

feat(app): share an image into Freegle to start an Offer (iOS) [dark]#759

Closed
edwh wants to merge 1 commit into
feat/share-into-freeglefrom
feat/share-into-freegle-ios
Closed

feat(app): share an image into Freegle to start an Offer (iOS) [dark]#759
edwh wants to merge 1 commit into
feat/share-into-freeglefrom
feat/share-into-freegle-ios

Conversation

@edwh

@edwh edwh commented Jun 14, 2026

Copy link
Copy Markdown
Member

What

The iOS half of Share-into-Freegle. Adds an iOS share-sheet extension so a
photo can be shared straight into a new OFFER with the image pre-attached —
the iOS counterpart to the Android ACTION_SEND work in #758.

Stacked on #758. This PR is based on feat/share-into-freegle (Android) and
reuses its pendingSharedImages give-flow path. Merge #758 first (GitHub will
retarget this PR's base to master), or merge them together.

⚠️ DARK / flag-gated — safe to merge, does nothing until enabled

Everything is a no-op unless ENABLE_SHARE_EXTENSION=true. By default the
Xcode project, the main app's entitlements and its signing/export are
byte-for-byte unchanged, so this cannot affect the weekly App Store
release
until deliberately enabled. The disabled export composes to exactly
today's app(+NSE) provisioning map.

Enabling requires these human, Apple-Developer-portal steps first (no code
can do them — they need interactive Apple ID + 2FA):

  1. Register App Group group.org.ilovefreegle.iphone; enable it on both App
    IDs (org.ilovefreegle.iphone and org.ilovefreegle.iphone.ShareExtension).
  2. Pre-create the .ShareExtension App ID + an App Store distribution profile
    (same "create once by hand" approach as the NSE).
  3. Regenerate the main app App Store profile so it includes the App Group.
  4. Set ENABLE_SHARE_EXTENSION=true in the deploy-apps CircleCI context.

…then on-device verification (native code is not buildable locally).

How

  • ShareViewController.swift — no-UI handler: copies the shared image(s) into
    the App Group container, then opens the host app with
    freegleshare://shared?p=<path>… via the responder-chain openURL: technique.
  • ShareExtension/Info.plistcom.apple.share-services, image activation
    rule, programmatic principal class (no storyboard to get wrong).
  • ShareExtension.entitlements — App Group.
  • App/Info.plist — registers the freegleshare:// URL scheme.
  • add_share_extension_target.rb — gated; adds the target and (build-time
    only, never committed) the App Group entitlement to the main app. Mirrors
    add_nse_target.rb.
  • Fastfile — gated wiring + signing + a composed export map (disabled build
    == today's export).
  • stores/mobile.jsappUrlOpen catches freegleshare://shared and queues
    the image(s) into the same pendingSharedImages/give/mobile/photos
    path as Android.

Risk / testing

  • Default build path is provably unchanged (flag off). Validated: edited Fastfile
    and the new Ruby script both pass ruby -c; all plists are well-formed;
    mobile.js passes node --check.
  • Native Swift can't be compiled locally — needs the on-device test above.
  • The one runtime assumption to verify on-device: Capacitor.convertFileSrc()
    serving the App Group container path to the WKWebView. If it doesn't, the fix
    is to copy app-group→app-tmp in AppDelegate before forwarding the URL.

Part of Share-into-Freegle. Companion: #758 (Android).

🤖 Generated with Claude Code

iOS half of Share-into-Freegle (Android is in the parent commit). Adds an
iOS share-sheet extension so a photo can be shared straight into a new OFFER
with the image pre-attached.

DARK / FLAG-GATED: everything is a no-op unless ENABLE_SHARE_EXTENSION=true.
By default the Xcode project, the main app's entitlements and signing are
byte-for-byte unchanged, so this cannot affect the weekly App Store release
until deliberately enabled. Enabling first requires (human, Apple-portal):
  1. Register App Group group.org.ilovefreegle.iphone and enable it on both
     App IDs (org.ilovefreegle.iphone and .ShareExtension).
  2. Pre-create the .ShareExtension App ID + App Store distribution profile.
  3. Regenerate the main app profile so it includes the App Group.
  4. Set ENABLE_SHARE_EXTENSION=true in the deploy-apps CircleCI context.
Then on-device verification.

- ios/App/ShareExtension/ShareViewController.swift — no-UI share handler:
  copies shared image(s) into the App Group container and opens the host app
  with freegleshare://shared?p=<path>... (responder-chain openURL).
- ios/App/ShareExtension/Info.plist — share-services extension, image
  activation rule, programmatic principal class (no storyboard).
- ios/App/ShareExtension/ShareExtension.entitlements — App Group.
- ios/App/App/Info.plist — register the freegleshare:// URL scheme.
- fastlane/add_share_extension_target.rb — gated; adds the target + (build-time
  only) the App Group entitlement to the main app. Mirrors add_nse_target.rb.
- fastlane/Fastfile — gated wiring + signing + export map, composed so a
  disabled build is identical to today's app(+NSE) export.
- stores/mobile: appUrlOpen handles freegleshare://shared, queuing the
  image(s) into the same pendingSharedImages give-flow path as Android.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@edwh

edwh commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Superseded by #766, which consolidates the native-app feature PRs (#756 haptics, #757 app-icon shortcuts, #758 share-into-Freegle Android, #759 share-into-Freegle iOS) into a single PR rebased onto current master. Branch kept (not deleted) in case it's needed.

@edwh edwh closed this Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: Passed CI build passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants