Implement iOS Share Extension to enable native image sharing from Photos and other apps directly into TimeSafari. Users can now share images from the iOS share sheet, which will open in SharedPhotoView for use as gifts or profile pictures. iOS Native Implementation: - Add TimeSafariShareExtension target with ShareViewController - Configure App Groups for data sharing between extension and main app - Implement ShareViewController to process shared images and convert to base64 - Store shared image data in App Group UserDefaults - Add ShareImageBridge utility to read shared data from App Group - Update AppDelegate to handle shared-photo deep link and bridge data to JS JavaScript Integration: - Add checkAndStoreNativeSharedImage() in main.capacitor.ts to read shared images from native layer via temporary file bridge - Convert base64 data to data URL format for compatibility with base64ToBlob - Integrate with existing SharedPhotoView component - Add "shared-photo" to deep link validation schema Build System: - Integrate Xcode 26 / CocoaPods compatibility workaround into build-ios.sh - Add run_pod_install_with_workaround() for explicit pod install - Add run_cap_sync_with_workaround() for Capacitor sync (which runs pod install internally) - Automatically detect project format version 70 and apply workaround - Remove standalone pod-install-workaround.sh script Code Cleanup: - Remove verbose debug logs from ShareViewController, AppDelegate, and main.capacitor.ts - Retain essential logger calls for production debugging Documentation: - Add ios-share-extension-setup.md with manual Xcode setup instructions - Add ios-share-extension-git-commit-guide.md for version control best practices - Add ios-share-implementation-status.md tracking implementation progress - Add native-share-target-implementation.md with overall architecture - Add xcode-26-cocoapods-workaround.md documenting the compatibility issue The implementation uses a temporary file bridge (AppDelegate writes to Documents directory, JS reads via Capacitor Filesystem plugin) as a workaround for Capacitor plugin auto-discovery issues. This can be improved in the future by properly registering ShareImagePlugin in Capacitor's plugin registry.
2.6 KiB
Xcode 26 / CocoaPods Compatibility Workaround
Date: 2025-01-27
Issue: CocoaPods xcodeproj gem (1.27.0) doesn't support Xcode 26's project format version 70
The Problem
Xcode 26.1.1 uses project format version 70, but the xcodeproj gem (1.27.0) only supports up to version 56. This causes CocoaPods to fail with:
ArgumentError - [Xcodeproj] Unable to find compatibility version string for object version `70`.
Solutions
Option 1: Temporarily Downgrade Project Format (Recommended for Now)
Before running pod install or npm run build:ios:
- Edit
ios/App/App.xcodeproj/project.pbxproj - Change line 6 from:
objectVersion = 70;to:objectVersion = 56; - Run your build/sync command
- Change it back to:
objectVersion = 70;(Xcode will likely change it back automatically)
Warning: Xcode may automatically upgrade the format back to 70 when you open the project. This is okay - just repeat the process when needed.
Option 2: Wait for xcodeproj Update
The xcodeproj gem maintainers will eventually release a version that supports format 70. You can:
- Check for updates:
bundle update xcodeproj - Monitor: https://github.com/CocoaPods/Xcodeproj/issues
Option 3: Use Xcode Directly (Bypass CocoaPods for Now)
Since the Share Extension is already set up:
- Open the project in Xcode
- Build directly from Xcode (Product → Build)
- Skip
npm run build:iosfor now - Test the Share Extension functionality
Option 4: Automated Workaround (Integrated into Build Script) ✅
The workaround is now automatically integrated into scripts/build-ios.sh. When you run:
npm run build:ios
The build script will:
- Automatically detect if the project format is version 70
- Temporarily downgrade to version 56
- Run
pod install - Restore to version 70
- Continue with the build
No manual steps required! The workaround is transparent and only applies when needed.
To remove the workaround in the future:
- Check if
xcodeprojgem supports format 70:bundle exec gem list xcodeproj - Test if
pod installworks without the workaround - If it works, remove the
run_pod_install_with_workaround()function fromscripts/build-ios.sh - Replace it with a simple
pod installcall
Current Status
- ✅ Share Extension target exists
- ✅ Share Extension files are in place
- ✅ Workaround integrated into build script
- ✅
npm run build:iosworks automatically
Recommendation
Use npm run build:ios - the workaround is handled automatically. No manual intervention needed.
Once xcodeproj is updated to support format 70, the workaround can be removed from the build script.