Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore manual entries from Apple Health app as Data Source

Tags:

ios

healthkit

Hi I'm writing a Fitness App which gets its Data from Apples Health app.

So far so good.

Problem: in Health app it is possible to make manually data entries which makes it possible to cheat.

Question: how can i exclude or ignore this specific Data Entries.

Just the Data with "Source: Health" so i've still the possibility to read data from a random Fitness tracker.

like image 657
Jopi Avatar asked Jul 02 '15 12:07

Jopi


People also ask

How do I stop Health app from collecting data?

There's no master setting to stop Apple Health collecting data from your devices once you've turned it on, but you can effectively stop it by blocking its access to the sensors in your phone. From iOS Settings, tap Privacy, then Motion & Fitness, then turn off the Fitness Tracking option.

How do I stop Apple Health app from sharing data?

Stop sharing health dataOn your iPhone, open the Health app. Tap Sharing. Select an individual or provider under You're Sharing With. Turn off a health topic to stop sharing that data.

How do I stop iPhone from downloading health data?

To stop storing your Health data in iCloud, go to Settings > [your name] > iCloud and turn off Health. Health data from Family Setup devices are also backed up directly to iCloud.


1 Answers

Samples in HealthKit that were manually entered by the user will have have a YES value for the HKMetadataKeyWasUserEntered metadata key. To create a predicate that matches only samples that were not user-entered, you could do use the following:

[NSPredicate predicateWithFormat:@"metadata.%K != YES", HKMetadataKeyWasUserEntered];

Note that this must be formulated as value != YES because the value for the key could be YES, NO, or nil and nil implies NO.

like image 56
Allan Avatar answered Sep 18 '22 07:09

Allan