Posts

Post not yet marked as solved
515 Views

Observing heart rate from Apple watchOS2 workout in realtime on IOS9 app?

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]; } }]; }
Asked
by Ron Wood.
Last updated
.
Post not yet marked as solved
866 Views

Xcode 11 how to delete the MAC version of a multi device target IOS app (iPhone, iPad, Mac)

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.
Asked
by Ron Wood.
Last updated
.
Post not yet marked as solved
250 Views

Metering DRM protected files from iPod-libaray possible?

I am using MPMusicPlayerController for playing back DRM protected files from the iPod-libaray and I would like to build an vu-meter for metering the volume of the song. I found some discussions which recommend to use MPMediaItemPropertyAssetURL and AudioPlayer but [(MPMediaItem*)song valueForProperty:MPMediaItemPropertyAssetURL] of DRM protected audio files is NULL? Is there any possibility for metering DRM files from iPod-libaray?I tried to record with the build in microphon during playback of DRM files but it seems that is not possible, too?
Asked
by Ron Wood.
Last updated
.