Posts

Post not yet marked as solved
3 Replies
1.3k Views
I created a HKObserverQuery for HKQuantityTypeIdentifierHeartRate which works fime when the app starts or if the app goes to background and back to foreground, only at that stages I see the health kit data from a running watch workout IN REALTIME. That means the data is transmitted to the iPhone in realtime but the HKObserverQuery only fires at startup or when coming back to foreground. Is this a bug? PS: If I enter mannualy a heart rate into the health app on the iPhone the HKObserverQuery fires correct!Here is my code snipp: if ([HKHealthStore isHealthDataAvailable]) { NSSet *readDataTypes = [self dataTypesToRead]; [self.healthStore requestAuthorizationToShareTypes:nil readTypes:readDataTypes completion:^(BOOL success, NSError *error) { if (!success) { NSLog(@"%@ - You didn't allow HealthKit to access these read/write data types. In your app, try to handle this error gracefully when a user decides not to provide access. The error was: %@. If you're using a simulator, try it on a device.", [self class], error); return; } else { UIBackgroundTaskIdentifier __block taskID = [application beginBackgroundTaskWithExpirationHandler:^{ if (taskID != UIBackgroundTaskInvalid) { [application endBackgroundTask:taskID]; taskID = UIBackgroundTaskInvalid; } }]; HKSampleType *sampleType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]; [healthStore enableBackgroundDeliveryForType:sampleType frequency:HKUpdateFrequencyImmediate withCompletion:^(BOOL success, NSError *error) {}]; HKQuery *query = [[HKObserverQuery alloc] initWithSampleType:sampleType predicate:nil updateHandler: ^void(HKObserverQuery *query, HKObserverQueryCompletionHandler completionHandler, NSError *error) { if (error) { NSLog(@"*** An error occured while setting up the observer. %@ ***", error.localizedDescription); abort(); } else { NSLog(@"*** Setting up the observer. SUCCESS ***"); } / if (completionHandler) { completionHandler(); } NSLog(@"*** NEW or DELETED heart rate data ***"); / if (taskID != UIBackgroundTaskInvalid) { [application endBackgroundTask:taskID]; taskID = UIBackgroundTaskInvalid; } }]; [healthStore executeQuery:query]; } }]; }
Posted
by Ron Wood.
Last updated
.
Post not yet marked as solved
1 Replies
3.3k Views
I need to completely delete my IOS app because of a core data problem. The app should start with as it never had been tested on the MAC. On the simulator and on the physical iPhone and iPad I can delete the app, but I can't figure out where the MAC version is physically stored on the MAC? I already did a clean build folder and deleted the derived data folder (I found the core data itself under Data/Library/Application Support) but not where I can delete the entire app.
Posted
by Ron Wood.
Last updated
.