Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure HealthKit and notification authorizations #6

Merged
merged 16 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Behavior/BehaviorDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@

dhruvna1k marked this conversation as resolved.
Show resolved Hide resolved
class BehaviorDelegate: SpeziAppDelegate {
override var configuration: Configuration {
Configuration(standard: BehaviorStandard()) {

Check failure on line 23 in Behavior/BehaviorDelegate.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint

Closure Body Length Violation: Closure body should span 35 lines or less excluding comments and whitespace: currently spans 41 lines (closure_body_length)
if HKHealthStore.isHealthDataAvailable() {
HealthKit {
CollectSample(
HKQuantityType(.stepCount),
deliverySetting: .background(.afterAuthorizationAndApplicationWillLaunch)
)
CollectSample(
HKQuantityType(.activeEnergyBurned),
deliverySetting: .anchorQuery(.afterAuthorizationAndApplicationWillLaunch)
)
}
}

dhruvna1k marked this conversation as resolved.
Show resolved Hide resolved
if !FeatureFlags.disableFirebase {
AccountConfiguration(configuration: [
.requires(\.userId),
Expand Down
3 changes: 2 additions & 1 deletion Behavior/Onboarding/OnboardingFlow.swift
dhruvna1k marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ struct OnboardingFlow: View {
HealthKitPermissions()
}

if !localNotificationAuthorization {
/*if !localNotificationAuthorization {
NotificationPermissions()
}
*/
dhruvna1k marked this conversation as resolved.
Show resolved Hide resolved
}
.task {
localNotificationAuthorization = await scheduler.localNotificationAuthorization
Expand Down