Skip to content

Commit 10a3571

Browse files
author
victor kachalov
committed
add workout route
- migrate project to Apple M1 - add release entititlements - adjust local run for iOS 15+
1 parent 08b70ad commit 10a3571

21 files changed

+1915
-1559
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [2.0.1] - 17.04.2022
2+
3+
* Add workout route as query method, remove it as event stream
4+
* Minor fixes in the code
5+
16
## [2.0.0] - 09.03.2022
27

38
* A way not to provide a predicate where it can be omitted

example/ios/Podfile.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ PODS:
22
- Flutter (1.0.0)
33
- flutter_local_notifications (0.0.1):
44
- Flutter
5-
- health_kit_reporter (1.5.1):
5+
- health_kit_reporter (1.5.2):
66
- Flutter
77
- HealthKitReporter
8-
- HealthKitReporter (1.6.2)
8+
- HealthKitReporter (1.6.3)
99

1010
DEPENDENCIES:
1111
- Flutter (from `Flutter`)
@@ -27,9 +27,9 @@ EXTERNAL SOURCES:
2727
SPEC CHECKSUMS:
2828
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
2929
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
30-
health_kit_reporter: 60f4e901356f465779dc4a9a315a045721c52f78
31-
HealthKitReporter: e17195a40b8245d8bfa1d80e52bc8297eae9d3be
30+
health_kit_reporter: 6da8c20414d6a53cf2babcfd0314ea05a943bd3e
31+
HealthKitReporter: 42ebaa50989c4e4f6171b2caa3388c53519bea33
3232

3333
PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa
3434

35-
COCOAPODS: 1.11.0
35+
COCOAPODS: 1.11.2

example/ios/Runner.xcodeproj/project.pbxproj

+20-7
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@
4141
586D67CD4E75BA279D8761E9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4242
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4343
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
44+
788ED29B2803689500B4EDFC /* Info-Release.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Release.plist"; sourceTree = "<group>"; };
45+
789DA6722802F98A005C51A4 /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = "<group>"; };
4446
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4547
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
4648
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
4749
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
4850
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4951
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5052
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
51-
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
53+
97C147021CF9000F007C117D /* Info-Debug.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Debug.plist"; sourceTree = "<group>"; };
5254
9EEFACBE630AB7D54BBDC1AE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
5355
D20DBD967B4CDA1DD77298C0 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
5456
/* End PBXFileReference section */
@@ -100,11 +102,13 @@
100102
97C146F01CF9000F007C117D /* Runner */ = {
101103
isa = PBXGroup;
102104
children = (
105+
789DA6722802F98A005C51A4 /* RunnerRelease.entitlements */,
103106
1726D0AA255C690100A8CD8B /* Runner.entitlements */,
104107
97C146FA1CF9000F007C117D /* Main.storyboard */,
105108
97C146FD1CF9000F007C117D /* Assets.xcassets */,
106109
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
107-
97C147021CF9000F007C117D /* Info.plist */,
110+
97C147021CF9000F007C117D /* Info-Debug.plist */,
111+
788ED29B2803689500B4EDFC /* Info-Release.plist */,
108112
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
109113
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
110114
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
@@ -163,7 +167,7 @@
163167
97C146E61CF9000F007C117D /* Project object */ = {
164168
isa = PBXProject;
165169
attributes = {
166-
LastUpgradeCheck = 1200;
170+
LastUpgradeCheck = 1300;
167171
ORGANIZATIONNAME = "";
168172
TargetAttributes = {
169173
97C146ED1CF9000F007C117D = {
@@ -365,14 +369,16 @@
365369
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
366370
CLANG_ENABLE_MODULES = YES;
367371
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
372+
CODE_SIGN_IDENTITY = "Apple Development";
373+
CODE_SIGN_STYLE = Automatic;
368374
CURRENT_PROJECT_VERSION = 1;
369375
DEVELOPMENT_TEAM = MAVP5V2N7V;
370376
ENABLE_BITCODE = NO;
371377
FRAMEWORK_SEARCH_PATHS = (
372378
"$(inherited)",
373379
"$(PROJECT_DIR)/Flutter",
374380
);
375-
INFOPLIST_FILE = Runner/Info.plist;
381+
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
376382
LD_RUNPATH_SEARCH_PATHS = (
377383
"$(inherited)",
378384
"@executable_path/Frameworks",
@@ -384,6 +390,7 @@
384390
MARKETING_VERSION = 1.2.0;
385391
PRODUCT_BUNDLE_IDENTIFIER = com.kvs.healthKitReporterExample;
386392
PRODUCT_NAME = "$(TARGET_NAME)";
393+
PROVISIONING_PROFILE_SPECIFIER = "";
387394
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
388395
SWIFT_VERSION = 5.0;
389396
VERSIONING_SYSTEM = "apple-generic";
@@ -506,14 +513,16 @@
506513
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
507514
CLANG_ENABLE_MODULES = YES;
508515
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
516+
CODE_SIGN_IDENTITY = "Apple Development";
517+
CODE_SIGN_STYLE = Automatic;
509518
CURRENT_PROJECT_VERSION = 1;
510519
DEVELOPMENT_TEAM = MAVP5V2N7V;
511520
ENABLE_BITCODE = NO;
512521
FRAMEWORK_SEARCH_PATHS = (
513522
"$(inherited)",
514523
"$(PROJECT_DIR)/Flutter",
515524
);
516-
INFOPLIST_FILE = Runner/Info.plist;
525+
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
517526
LD_RUNPATH_SEARCH_PATHS = (
518527
"$(inherited)",
519528
"@executable_path/Frameworks",
@@ -525,6 +534,7 @@
525534
MARKETING_VERSION = 1.2.0;
526535
PRODUCT_BUNDLE_IDENTIFIER = com.kvs.healthKitReporterExample;
527536
PRODUCT_NAME = "$(TARGET_NAME)";
537+
PROVISIONING_PROFILE_SPECIFIER = "";
528538
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
529539
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
530540
SWIFT_VERSION = 5.0;
@@ -538,15 +548,17 @@
538548
buildSettings = {
539549
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
540550
CLANG_ENABLE_MODULES = YES;
541-
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
551+
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
552+
CODE_SIGN_IDENTITY = "Apple Development";
553+
CODE_SIGN_STYLE = Automatic;
542554
CURRENT_PROJECT_VERSION = 1;
543555
DEVELOPMENT_TEAM = MAVP5V2N7V;
544556
ENABLE_BITCODE = NO;
545557
FRAMEWORK_SEARCH_PATHS = (
546558
"$(inherited)",
547559
"$(PROJECT_DIR)/Flutter",
548560
);
549-
INFOPLIST_FILE = Runner/Info.plist;
561+
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
550562
LD_RUNPATH_SEARCH_PATHS = (
551563
"$(inherited)",
552564
"@executable_path/Frameworks",
@@ -558,6 +570,7 @@
558570
MARKETING_VERSION = 1.2.0;
559571
PRODUCT_BUNDLE_IDENTIFIER = com.kvs.healthKitReporterExample;
560572
PRODUCT_NAME = "$(TARGET_NAME)";
573+
PROVISIONING_PROFILE_SPECIFIER = "";
561574
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
562575
SWIFT_VERSION = 5.0;
563576
VERSIONING_SYSTEM = "apple-generic";

example/ios/Runner/Info-Debug.plist

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>health_kit_reporter_example</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>$(MARKETING_VERSION)</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>$(CURRENT_PROJECT_VERSION)</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>NSBonjourServices</key>
26+
<array>
27+
<string>_dartobservatory._tcp</string>
28+
</array>
29+
<key>NSHealthShareUsageDescription</key>
30+
<string>Share your data with our super cool app</string>
31+
<key>NSHealthUpdateUsageDescription</key>
32+
<string>This super cool app wants to write some data</string>
33+
<key>UIBackgroundModes</key>
34+
<array>
35+
<string>fetch</string>
36+
</array>
37+
<key>UILaunchStoryboardName</key>
38+
<string>LaunchScreen</string>
39+
<key>UIMainStoryboardFile</key>
40+
<string>Main</string>
41+
<key>UISupportedInterfaceOrientations</key>
42+
<array>
43+
<string>UIInterfaceOrientationPortrait</string>
44+
<string>UIInterfaceOrientationLandscapeLeft</string>
45+
<string>UIInterfaceOrientationLandscapeRight</string>
46+
</array>
47+
<key>UISupportedInterfaceOrientations~ipad</key>
48+
<array>
49+
<string>UIInterfaceOrientationPortrait</string>
50+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
51+
<string>UIInterfaceOrientationLandscapeLeft</string>
52+
<string>UIInterfaceOrientationLandscapeRight</string>
53+
</array>
54+
<key>UIViewControllerBasedStatusBarAppearance</key>
55+
<false/>
56+
</dict>
57+
</plist>
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.developer.healthkit</key>
6+
<true/>
7+
<key>com.apple.developer.healthkit.access</key>
8+
<array/>
9+
<key>com.apple.developer.healthkit.background-delivery</key>
10+
<true/>
11+
</dict>
12+
</plist>

example/lib/main.dart

+14-14
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ class _MyAppState extends State<MyApp> {
162162
queryHeartbeatSeries();
163163
},
164164
child: Text('heartbeatSeriesQuery')),
165+
ElevatedButton(
166+
onPressed: () {
167+
workoutRouteQuery();
168+
},
169+
child: Text('workoutRouteQuery')),
165170
ElevatedButton(
166171
onPressed: () {
167172
querySources();
@@ -237,11 +242,6 @@ class _MyAppState extends State<MyApp> {
237242
statisticsCollectionQuery();
238243
},
239244
child: Text('statisticsCollectionQuery')),
240-
ElevatedButton(
241-
onPressed: () {
242-
workoutRouteQuery();
243-
},
244-
child: Text('workoutRouteQuery')),
245245
],
246246
),
247247
Column(
@@ -456,6 +456,15 @@ class _MyAppState extends State<MyApp> {
456456
}
457457
}
458458

459+
void workoutRouteQuery() async {
460+
try {
461+
final series = await HealthKitReporter.workoutRouteQuery(_predicate);
462+
print('workoutRoutes: ${series.map((e) => e.map).toList()}');
463+
} catch (e) {
464+
print(e);
465+
}
466+
}
467+
459468
void queryCharacteristics() async {
460469
try {
461470
final characteristics = await HealthKitReporter.characteristicsQuery();
@@ -509,15 +518,6 @@ class _MyAppState extends State<MyApp> {
509518
}
510519
}
511520

512-
void workoutRouteQuery() {
513-
final sub =
514-
HealthKitReporter.workoutRouteQuery(_predicate, onUpdate: (serie) {
515-
print('Updates for workoutRouteQuery');
516-
print(serie.map);
517-
});
518-
print('workoutRouteQuery: $sub');
519-
}
520-
521521
void anchoredObjectQuery(List<String> identifiers) {
522522
final sub = HealthKitReporter.anchoredObjectQuery(identifiers, _predicate,
523523
onUpdate: (samples, deletedObjects) {

example/pubspec.lock

+20-13
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.8.1"
10+
version: "2.8.2"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -21,7 +21,7 @@ packages:
2121
name: characters
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.1.0"
24+
version: "1.2.0"
2525
charcode:
2626
dependency: transitive
2727
description:
@@ -49,7 +49,7 @@ packages:
4949
name: cupertino_icons
5050
url: "https://pub.dartlang.org"
5151
source: hosted
52-
version: "1.0.2"
52+
version: "1.0.4"
5353
fake_async:
5454
dependency: transitive
5555
description:
@@ -68,14 +68,14 @@ packages:
6868
name: flutter_local_notifications
6969
url: "https://pub.dartlang.org"
7070
source: hosted
71-
version: "5.0.0-nullsafety.1"
71+
version: "5.0.0+4"
7272
flutter_local_notifications_platform_interface:
7373
dependency: transitive
7474
description:
7575
name: flutter_local_notifications_platform_interface
7676
url: "https://pub.dartlang.org"
7777
source: hosted
78-
version: "3.0.0-nullsafety.4"
78+
version: "3.0.0"
7979
flutter_test:
8080
dependency: "direct dev"
8181
description: flutter
@@ -87,14 +87,21 @@ packages:
8787
path: ".."
8888
relative: true
8989
source: path
90-
version: "1.5.1"
90+
version: "2.0.0"
9191
matcher:
9292
dependency: transitive
9393
description:
9494
name: matcher
9595
url: "https://pub.dartlang.org"
9696
source: hosted
97-
version: "0.12.10"
97+
version: "0.12.11"
98+
material_color_utilities:
99+
dependency: transitive
100+
description:
101+
name: material_color_utilities
102+
url: "https://pub.dartlang.org"
103+
source: hosted
104+
version: "0.1.3"
98105
meta:
99106
dependency: transitive
100107
description:
@@ -115,14 +122,14 @@ packages:
115122
name: platform
116123
url: "https://pub.dartlang.org"
117124
source: hosted
118-
version: "3.0.0"
125+
version: "3.1.0"
119126
plugin_platform_interface:
120127
dependency: transitive
121128
description:
122129
name: plugin_platform_interface
123130
url: "https://pub.dartlang.org"
124131
source: hosted
125-
version: "2.0.0"
132+
version: "2.1.2"
126133
sky_engine:
127134
dependency: transitive
128135
description: flutter
@@ -169,14 +176,14 @@ packages:
169176
name: test_api
170177
url: "https://pub.dartlang.org"
171178
source: hosted
172-
version: "0.4.2"
179+
version: "0.4.8"
173180
timezone:
174181
dependency: transitive
175182
description:
176183
name: timezone
177184
url: "https://pub.dartlang.org"
178185
source: hosted
179-
version: "0.7.0-nullsafety.0"
186+
version: "0.7.0"
180187
typed_data:
181188
dependency: transitive
182189
description:
@@ -190,7 +197,7 @@ packages:
190197
name: vector_math
191198
url: "https://pub.dartlang.org"
192199
source: hosted
193-
version: "2.1.0"
200+
version: "2.1.1"
194201
sdks:
195-
dart: ">=2.12.0 <3.0.0"
202+
dart: ">=2.14.0 <3.0.0"
196203
flutter: ">=1.20.0"

0 commit comments

Comments
 (0)