Skip to content

Install & Configure

Setting the package up has two parts. This page covers the first one: the Dart dependency and the iOS project settings. The second half is the companion watch app.

pubspec.yaml
dependencies:
flutter:
sdk: flutter
carp_core: ^latest
carp_mobile_sensing: ^latest
carp_aware_package: ^latest
Terminal window
flutter pub get
import 'package:carp_core/carp_core.dart';
import 'package:carp_mobile_sensing/carp_mobile_sensing.dart';
import 'package:carp_aware_package/carp_aware_package.dart';
void main() {
SamplingPackageRegistry().register(AppleWatchSamplingPackage());
// ... the rest of your app
}

Registering makes the nine watch measure types available, it registers the AppleWatchDevice so protocols containing one can be deserialized, and it hands CAMS the AppleWatchDeviceManager that communicates with the watch.

The AWARE watchOS framework is distributed only through Swift Package Manager. There is no CocoaPods podspec so make sure SwiftPM is enabled:

Terminal window
flutter config --enable-swift-package-manager

Verify it took effect:

Terminal window
flutter config --list | grep swift-package-manager
# enable-swift-package-manager: true

The AWARE framework requires minimum iOS 16.

  1. The Xcode project

    Open ios/Runner.xcworkspace, select the Runner project → Runner target → General → Minimum Deployments → iOS 16.0. Set it on the project as well as the target if they differ.

  2. The Podfile

    In ios/Podfile, uncomment and set the platform line:

    ios/Podfile
    platform :ios, '16.0'
  3. The Flutter framework plist

    In ios/Flutter/AppFrameworkInfo.plist:

    ios/Flutter/AppFrameworkInfo.plist
    <plist version="1.0">
    <dict>
    ...
    <key>MinimumOSVersion</key>
    <string>16.0</string>
    </dict>
    </plist>
  4. Re-resolve

    Terminal window
    cd ios && pod install && cd ..

5. Generate the SwiftPM package and check it resolved

Section titled “5. Generate the SwiftPM package and check it resolved”
Terminal window
flutter build ios --config-only
open ios/Runner.xcworkspace

In the Xcode Project navigator you should now see Package Dependencies → FlutterGeneratedPluginSwiftPackage, and carp_aware_package under it.

The AWARE framework itself is not listed as a package. Currently it ships with the plugin as pre-compiled binaries.

Not supported