Settings Sent to the Watch
When the watch app calls AWWCSessionManager.shared.applyiPhoneSettings, the phone
answers with the dictionary below. Every value comes from the AppleWatchDevice in the
deployed study protocol, produced by AppleWatchDevice.toWatchSettings().
You need this page if you are writing your own watch app, extending the one in this documentation, or debugging why a setting did not take effect.
The settings dictionary
Section titled “The settings dictionary”| Key | Type | Applied automatically by AWARE | From AppleWatchDevice |
|---|---|---|---|
label |
String | ✓ sensor.set(label:) |
label |
db_host |
String | ✓ dbEngine.config.host |
awareServerUrl |
debug |
Bool | ✓ syncConfig.debug |
enableNativeLogging |
motion_sensor_hz |
Int | — | motionSamplingRate |
watch_motion_enabled |
Bool | — | motionEnabled |
watch_motion_accelerometer_enabled |
Bool | — | accelerometerEnabled |
watch_motion_device_motion_enabled |
Bool | — | deviceMotionEnabled |
watch_battery_enabled |
Bool | — | batteryEnabled |
watch_device_enabled |
Bool | — | deviceInfoEnabled |
watch_healthkit_enabled |
Bool | — | heartRateEnabled |
watch_location_enabled |
Bool | — | locationEnabled |
watch_heading_enabled |
Bool | — | headingEnabled |
watch_bluetooth_enabled |
Bool | — | bluetoothEnabled |
watch_audio_enabled |
Bool | — | audioEnabled |
watch_audio_ambient_noise_enabled |
Bool | — | ambientNoiseEnabled |
watch_audio_classification_enabled |
Bool | — | audioClassificationEnabled |
watch_audio_duty_cycle_enabled |
Bool | — | audioDutyCycleEnabled |
watch_audio_active_duration |
Double (seconds) | — | audioActiveDuration |
watch_audio_rest_duration |
Double (seconds) | — | audioRestDuration |
file_transfer_interval_seconds |
Double (seconds) | — | fileTransferInterval |
watch_background_session_type |
String | — | backgroundSessionType |
watch_transfer_mode |
String | — | transferMode |
watch_delete_after_transfer |
Bool | — | deleteAfterTransfer |
Applied automatically by AWARE means the framework applies the value to every
registered sensor on its own. Everything else has to be read and applied by the watch app,
because only the watch app knows which sensors exist — that is what apply(settings:)
does in the example controller.
Phone-side only
Section titled “Phone-side only”One setting never reaches the watch:
| Key | From AppleWatchDevice |
Effect |
|---|---|---|
save_to_local_aware_database |
saveToLocalAwareDatabase |
Whether the phone also writes received records into its own AWARE database |
Adding a setting of your own
Section titled “Adding a setting of your own”Two small changes, one on each side:
Send it from Dart
Add the key to
AppleWatchDevice.toWatchSettings(). Keys the nativeAppleWatchSensor.Configdoes not recognise are forwarded to the watch unchanged, so no native change is needed on the phone.Read it on the watch
Pick it up in
apply(settings:)in your watch controller and apply it to the sensor configuration it belongs to.if let threshold = settings["my_custom_threshold"] as? Double {mySensor.CONFIG.threshold = threshold}
When settings take effect
Section titled “When settings take effect”Settings are pulled by the watch, not pushed to it. The watch app requests them:
- on startup, and
- whenever it calls
applyiPhoneSettings()— the Reload settings button in the example app.
After applying them the controller restarts the sensors, so a changed configuration takes effect immediately once it has been fetched. A protocol update therefore reaches the watch within one watch-app launch, not instantly.