[BUG] - Health authorization read only crash
gharary opened this issue · comments
Describe the bug
A clear and concise description of what the bug is.
PermissionSwiftUI 1.4.1
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Must request authorization for at least one data type'
To Reproduce
let readData = Set([HKObjectType.workoutType(),
HKObjectType.quantityType(forIdentifier: .stepCount)!,
HKObjectType.quantityType(forIdentifier: .distanceWalkingRunning)!,
HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)!
,HKObjectType.quantityType(forIdentifier: .appleStandTime)!
])
.JMModal(showModal:$showPermission,for:[.locationAlways,.health(categories: .init(read: readData)),.notification])
Expected behavior
A clear and concise description of what you expected to happen.
in mapPermissionAuthorizationStatus
, input
is Set<HKSampleType>
, however I'm using HKObjectType
and it cause error
***Update:
Tried with HKSampleType
but still crash as I click to allow permission of Health.
*** update:
tried to downcast to PermissionSwiftUI 1.3.0, everything working fine!