Installation
Add carp_aware_package to a Flutter app and prepare the iOS project.
Setting up the package has two parts. This page covers the first: the Dart dependency and the iOS project settings. The second part is the companion watch app.
Note
The package supports iOS and watchOS only. Android is not supported.
Add the dependency
Register the sampling package
Registering the package:
- makes the nine watch measure types available;
- registers
AppleWatchDevice, so protocols that contain one can be deserialized; - hands CAMS the
AppleWatchDeviceManagerthat communicates with the watch.
Enable Swift Package Manager
The AWARE watchOS framework is distributed only through Swift Package Manager. There is no CocoaPods podspec, so enable SwiftPM:
Verify that it took effect:
Set the iOS deployment target to 16.0
The AWARE framework requires iOS 16 or later. Set the deployment target in three places, then re-resolve the pods.
Set it in the Xcode project
Open
ios/Runner.xcworkspaceand select the Runner project → Runner target → General → Minimum Deployments → iOS 16.0. If the project and the target differ, set it on both.Set it in the Podfile
In
ios/Podfile, uncomment and set the platform line:ios/Podfile Set it in the Flutter framework plist
In
ios/Flutter/AppFrameworkInfo.plist:ios/Flutter/AppFrameworkInfo.plist Re-resolve the pods
Generate the Swift package and verify it
In the Xcode Project navigator, Package Dependencies → FlutterGeneratedPluginSwiftPackage now lists carp_aware_package.
The AWARE framework itself is not listed as a package. It currently ships with the plugin as pre-compiled binaries.
Next step
Add the companion watch app
Add the companion watchOS app. This step is required.