Skip to content

Add in-app camera with direct upload to Nextcloud#4058

Open
Rasmussw wants to merge 1 commit intonextcloud:masterfrom
Rasmussw:feature/direct-upload-camera-clean
Open

Add in-app camera with direct upload to Nextcloud#4058
Rasmussw wants to merge 1 commit intonextcloud:masterfrom
Rasmussw:feature/direct-upload-camera-clean

Conversation

@Rasmussw
Copy link
Copy Markdown

@Rasmussw Rasmussw commented Apr 8, 2026

This PR adds a custom in-app camera to the iOS client that captures photos and videos and uploads them directly to Nextcloud, bypassing the device camera roll by default. Users can optionally enable saving to the camera roll via a per-session toggle, with a global default available in Settings -> Advanced.

In the current flow, media is always saved to the system photo library before being uploaded to Nextcloud. This creates potentially unwanted local copies, introduces privacy concerns, and adds manual cleanup for users. This change ensures media can be captured and stored directly in Nextcloud without ever touching the camera roll. This is especially important in regulated environments with BYOD-policies, i.e. environments where media content captured can identify a person, thus potentially violating GDPR.

The custom camera uses AVFoundation to capture media directly to a temporary directory. Files are reviewed before upload and then passed into Nextcloud's existing upload pipeline. Saving to the camera roll is fully optional and only occurs if explicitly enabled by the user. Existing picker and upload flows remain unchanged.

Additional notes
Default behaviour does not affect existing users
Upload reliability uses existing background upload infrastructure
Camera roll is never accessed unless explicitly enabled

Introduces a custom AVFoundation camera that captures photos and videos
and uploads them directly to Nextcloud without saving to the device
camera roll by default.

- Custom camera UI: shutter, flash, flip, mode selector (photo/video)
- Pinch-to-zoom from 0.5x (ultra-wide) to 10x with live zoom label
- Virtual multi-camera support (triple/dual-wide) for sub-1x zoom
- Recording timer with red dot, screen stays on during video recording
- App backgrounding gracefully stops recording in progress
- Review screen after capture: retake or use, inline video playback
- "Save to camera roll" opt-in toggle per session (off by default)
- Global default for toggle in Settings -> Advanced
- Filenames follow Nextcloud conventions via createFileName(),
  including "Maintain original filename" mode (IMG_XXXX.JPG)
- Videos saved as .mov (QuickTime) matching Apple native camera format
- Restored live photo upload logic: livePhotoFile and nativeFormat
  were inadvertently removed in a previous refactor
- Fix: PHAuthorizationStatus.limited now correctly treated as authorized
- Fix: NCViewerQuickLookView crash when asset is nil after model change

Signed-off-by: Rasmus Wøldike <rswoldike@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant