I can able to read distanceWalkingRunning data on most of the devices. But in some devices data is not retrieving.
guard let disType = HKObjectType.quantityType(forIdentifier: .distanceWalkingRunning) else {
fatalError("*** Unable to get the distance ***")
}
let query = HKStatisticsCollectionQuery.init(quantityType: disType,
quantitySamplePredicate: nil,
options: [.cumulativeSum],
anchorDate: anchor,
intervalComponents: interval)
query.initialResultsHandler = {
query, results, error in
results?.enumerateStatistics(from: startDate,
to: Date(), with: { (result, stop) in
let distance = result.sumQuantity()?.doubleValue(for: HKUnit.mile()) ?? 0
})
}
healthStore.execute(query)
}
In the same model same version not working in few device.
Please guide me to get data on all devices. Thanks.
Post
Replies
Boosts
Views
Activity
Unable To Install 'app'. This app cannot be installed because its integrity cannot be verified.
I released an enterprise app for my organization. App worked well, but suddenly app not opened. When I reinstall and open this error showing.