iOS: don't always prompt the user for camera/mic access on app startup (#1075)
* WIP: adding full app lifecycle event support, and Ctrl+C/signal catch * iOS: don't always prompt the user for camera/mic access on app startup This fixes two unrelated but similar-structure issues, both on iOS: - `Cx::handle_repaint` ran a 32-slot encoder-capture sweep every frame, which lazy-created `AvCaptureAccess` and fired `requestAccessForMediaType:AVMediaTypeVideo` — i.e. the camera prompt — on every Makepad app, even ones that never touch the camera. Gate the loop on `av_capture.is_some()` and stop the three `video_encoder_*` methods in `apple_media.rs` from lazy-creating it; they now return `EncoderNotStarted` (or no-op for `push_frame`) when no encoder exists. - `AudioUnitAccess::new()` unconditionally activated the shared `AVAudioSession` with category `PlayAndRecord` + `VoiceChat` mode, which is wrong for playback-only apps (mic prompt + forced VPIO). Defer session config to a new `ensure_ios_session(for_input)` helper, called from `use_audio_inputs` (PlayAndRecord) and `use_audio_outputs` (Playback). Idempotent, never downgrades. * Added fuller lifecycle event support, plus ability to catch sigquit Tested working well on every platform except web/wasm, as I don't have a working setup able to test that.
K
Kevin Boos committed
e0549dc502ee8dbdb4a35100fd0919f32bf01e40
Parent: 5ec03ff
Committed by GitHub <noreply@github.com>
on 5/1/2026, 8:30:33 PM