Commit Graph

27 Commits

Author SHA1 Message Date
Jose Olarte III
0627cd32b7 refactor: remove unused ShareImage plugin code, simplify to temp file approach
Remove unused Capacitor plugin implementation and simplify shared image
handling to use only the temp file approach, which is already working
reliably for both iOS and Android.

Changes:
- Delete ios/App/App/ShareImagePlugin.swift (unused, never registered)
- Delete ios/App/App/ShareImageBridge.swift (only used by plugin)
- Remove ~80 lines of plugin fallback code from src/main.capacitor.ts
- Simplify error handling to single code path
- Add documentation comment explaining temp file approach and future
  plugin implementation possibility

Benefits:
- ~154 lines of code removed
- Single, consistent code path for both platforms
- Easier to maintain and debug
- No functional changes - temp file approach already working

The temp file approach uses Capacitor's Filesystem plugin to read shared
image data written by native code (AppDelegate on iOS, MainActivity on
Android). This is simpler and more reliable than the plugin approach,
which required registration and bridge setup.

Future improvement: Consider implementing Capacitor plugins for direct
native-to-JS communication if lower latency becomes a priority, though
the current approach performs well in production.
2025-11-27 21:23:34 +08:00
Jose Olarte III
eff4126043 feat(ios): improve share extension UX and fix image reload issues
Improve iOS share extension implementation to skip interstitial UI and
fix issues with subsequent image shares not updating the view.

iOS Share Extension Improvements:
- Replace SLComposeServiceViewController with custom UIViewController
  to eliminate interstitial "Post" button UI
- Use minimal URL (timesafari://) instead of deep link for app launch
- Implement app lifecycle detection via Capacitor appStateChange listener
  instead of relying solely on deep links

Deep Link and Navigation Fixes:
- Remove "shared-photo" from deep link schemas (no longer needed)
- Add empty path URL handling for share extension launches
- Implement processing lock to prevent duplicate image processing
- Add retry mechanism (300ms delay) to handle race conditions with
  AppDelegate writing temp files
- Use router.replace() when already on /shared-photo route to force refresh
- Clear old images from temp DB before storing new ones
- Delete temp file immediately after reading to prevent stale data

SharedPhotoView Component:
- Add route watcher (@Watch) to reload image when fileName query
  parameter changes
- Extract image loading logic into reusable loadSharedImage() method
- Improve error handling to clear image state on failures

This fixes the issue where sharing a second image while already on
SharedPhotoView would display the previous image instead of the new one.
2025-11-25 18:22:43 +08:00
Jose Olarte III
ae49c0e907 feat(ios): implement native share target for images
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.
2025-11-24 20:46:58 +08:00
Matthew Raymer
45a8859a19 fix(assets): resolve Android and iOS resource generation issues
Android build was failing due to missing drawable and mipmap directories
for splash screens and launcher icons. iOS was missing complete asset
catalog structure for app icons and splash screens.

- Create missing Android resource directories (drawable, mipmap-*)
- Add splash screen files to Android drawable directory
- Generate complete set of Android launcher icons
- Create iOS asset catalog structure with proper Contents.json files
- Generate 21 iOS assets (app icons + splash screens) using ImageMagick
- Add resource validation scripts for both platforms
- Enhance Android resource check to auto-create missing directories

NOTE: you need to test this from a fresh clone and after an npm install!

Android build now completes successfully. iOS assets ready for macOS/Xcode
builds. Both platforms have complete resource sets for development.
2025-08-13 07:07:48 +00:00
Jose Olarte III
b26bc73a0f Feature: lock orientation mode 2025-06-23 17:39:21 +08:00
Jose Olarte III
2b56f1f09b URL scheme config for iOS
- Registers the timesafari:// URL scheme
- Sets the bundle URL name to app.timesafari
2025-06-16 16:09:08 +08:00
987f9217de Merge branch 'sql-absurd-sql-back' 2025-06-07 17:18:10 -06:00
705c6092a3 disable SQLite in Java & Swift (since they don't compile) & add SQL queueing on startup
At this point, the app compiles and runs in Android & iOS but DB operations fail.
2025-06-03 19:59:28 -06:00
Matthew Raymer
1d1b37125d merge(master): big merge for qrcode-reboot 2025-06-02 03:57:00 +00:00
fca019fb2e fix spelling of SQLite module for iOS 2025-05-27 21:11:07 -06:00
Matthew Raymer
7b4f9d6556 fix: add requirements for capacitor/sqlite 2025-05-27 12:42:27 +00:00
b60e1462db add more ios tweaks for app store 2025-05-18 20:20:41 -06:00
Matt Raymer
06ed7d44ab chore: adjusting file location 2025-05-08 04:50:27 -04:00
Jose Olarte III
9f987d60a5 iOS camera usage description 2025-04-30 09:47:41 +08:00
Jose Olarte III
555b4a459d iOS Capacitor setup 2025-04-28 21:59:00 +08:00
90db509e5b modify files to make the ios build & distribution work 2025-04-18 20:40:41 -06:00
Matthew Raymer
a3f7e0e12f feat(android): implement file picker for data export
- Add @capawesome/capacitor-file-picker dependency
- Update DataExportSection UI text to reflect new file picker behavior
- Implement file picker in CapacitorPlatformService
- Add debug logging for path handling
- Fix logger to show messages in Capacitor environment

WIP: File path handling still needs refinement
2025-04-09 10:04:03 +00:00
6c349811d6 adjust instructions for capacitor-assets and more files 2025-04-06 19:48:45 -06:00
f970c472f5 restore important file from previous cleanup 2025-04-06 19:15:00 -06:00
c0fa897573 remove icon files that are generated by capacitor-assets 2025-04-06 19:02:01 -06:00
609d38e37e make changes that must have been done by XCode 2025-04-05 16:08:12 -06:00
4b0a3b7ec3 add important ios files that aren't regenerated 2025-04-05 16:03:44 -06:00
Matthew Raymer
4e0c88b85f chore: Remove folders 2025-03-10 03:38:24 +00:00
Matthew Raymer
1e22cdec82 feat(mobile): add deep linking support for Capacitor apps
Adds native deep linking capabilities:
- Configure timesafari:// URL scheme for iOS and Android
- Add @capacitor/app dependency and configuration
- Implement deep link handler with improved error logging
- Support parameterized routes like claim/:id
- Add debug logging for native platforms
- Handle app mounting state for deep links

Technical changes:
- Update AndroidManifest.xml with intent filters
- Add URL scheme to iOS Info.plist
- Add @capacitor/app to Podfile and Gradle
- Enhance main.capacitor.ts with robust deep link handling
2025-02-19 13:07:08 +00:00
Matthew Raymer
ff4e23517b Multi-build support; tested successfully for Electron 2025-01-07 09:40:31 +00:00
bd622e19a8 Revert "after npx cap add ... for ios & android"
This reverts commit 17f304ddb8.
2024-11-15 20:38:40 -07:00
f3b98ead3e after npx cap add ... for ios & android 2024-11-10 20:17:45 -07:00