CXR-L(EN)
cxr-l-sdk · v1.0.1 · snapshot 2026-05-13· ↗ source

Photo Capture

iOS: Photo Capture

Scenario

Trigger photo capture on the glasses and receive the JPEG byte stream as Data in a callback, then decode it into a UIImage for display or persistence on the phone.

Prerequisites

  • Authentication has succeeded and the link is ready (see “Connection and Session”).
  • The glasses-side scene is built: same as on Android, call takePhoto / takePhotoWithData only after the Custom View is running or the Custom App has been launched; avoid triggering capture merely when “connected”.

Key APIs (by name)

  • takePhotoWithData(width:height:quality:callback:): specify width/height and compression quality, and receive Data in the callback.

Example skeleton

client.takePhotoWithData(width: 1920, height: 1080, quality: 80) { data in
let image = UIImage(data: data)
// Update UIImageView, etc.
}

You can align parameters with the Android Sample 1024 x 768 quality 80 for joint debugging, then adjust per product.

Development suggestions

  • Higher resolution increases transfer latency.

Sample entry points (typical)

ActionCommon demo method name
Simple capturetakePhotoTapped
Capture with data callbacktakePhotoWithDataTapped
Preview viewphotoPreviewImageView

Please follow the actual code in ios_cxr_l_sample.

Marcin Miazga