Posts

Post not yet marked as solved
7 Replies
5.7k Views
Hi. iOS 10 has a new setting 'Temperature Unit'. Users can choose a temperature unit, independent of their Locale/Region.I had found this blog post, which explained how to get it's value: http://blog.timac.org/?tag=nslocaletemperatureunit. And it works great. I modified it a little bit so that it would be backwards compatible from iOS8 up to iOS10.However... When I submitted my app to Testflight, the app was rejected for the reason: "The app references non-public symbols in [app-name]: _NSLocaleTemperatureUnit"That's rather disappointing, because I know of no other way to find out what the user entered for this setting. I am 100% sure that users WILL change this setting, and then be disappointed that my app only looks at the region to determine if Celcius or Fahenrheit should be used.Is there any official solution for this predicament?Please check here what I did: http://stackoverflow.com/questions/39727075/determine-users-temperature-unit-setting-on-ios-10-celsius-fahrenheit
Posted Last updated
.
Post not yet marked as solved
0 Replies
379 Views
I am having this problem where if I run my application, 4 out of 5 times I don't see any output appearing in the debugger window. It is wasting my time a lot, I have to restart my app multiple times before I can see any debugger output.I was having this problem once in a while with previous Xcode builds, but now it's becoming unbearable. Especially because I am currently testing the app startup flow.Any tips to fix this?Could it maybe be related to our app using `CBCentralManagerOptionRestoreIdentifierKey`, which makes the app start in a slightly different way than normal use?
Posted Last updated
.
Post not yet marked as solved
0 Replies
364 Views
Hi All,My app is saving Blood Pressure correlations and Heart Rate samples. Heart Rate samples save great to HealthKit. But Blood Pressure correlations do not save correctly, and I can't figure out why.According to the code and the SDK, my Blood Pressure correlations are fine, and saved fine as well. However, if I then go look in the Health app, I see:* On the dashboard, the latest saved Blood Pressure correlation is shown fine. Values are there and correct, and the date is correct as well.* On the dashboard, I also see the corresponding Heart Rate sample.* On the chart, if I touch the items, it looks as if my Blood Pressure correlation is part of the sample set (but I can't go more specific than one day).* If I select Show All Data, then I just don't see my samples! They're just not there in the list. Not even the one that's shown on the dashboard.For the Heart Rate sample, everything is fine.Authorization is correct, I authorized everything.But sometimes, if I delete the app and reinstall it, then it suddenly does work. I am stumped. What's going on and how do I fix this?* iPhone 8 Plus* iOS 12.2* Xcode 10.2.1Edit:My app is using multiple HealthStore instances. Shouldn't be a problem, right?
Posted Last updated
.
Post not yet marked as solved
1 Replies
1k Views
Hi,I am making an app that imports data from HealthKit. For that, I have implemented a strategy using HKAnchoredObjectQuery.My strategy has two state: Syncing and Updating.When the app is started for the first time, and HealthKit is enabled, my importer starts in Syncing state. The sole reason for this is to be able to import all the existing HealthKit data in small batches (50 samples at a time). So I create a HKAnchoredObjectQuery to fetch the first bunch of samples (in this case BloodPressure correlations). The query object is initialised like this: ```HKAnchoredObjectQuery(type:HKObjectType.correlationType(forIdentifier: HKCorrelationTypeIdentifier.bloodPressure), predicate: nil, anchor: nil, limit: 50, resultsHandler: resultsHandler)```I have about 1500 bloodpressure samples in HealthKit.My strategy keeps doing this anchored object query with the previously returned anchor, until I receive 0 for samples and deletedSamples. Then the strategy is to move into an Updating state.In Updating state, I configure the anchored query as a long-running Update query with an updateHandler, and also still provide a resultsHandler (for the case I missed any new samples between the last Syncing query and the new Updating query. I pass a limit of HKObjectQueryNoLimit, as the API does not allow me to give a limit for update queries.Now, this works great. Except on ONE phone that I have. On this phone, the query that I fire in Syncing state, does not return 50 items, but only 1 item. And the next query I do with the new anchor return 0 items. And so my strategy thinks that all items have been synced and can go into the Updating state.However, in the Updating state, the first thing that happens is that my resultsHandler is called with all the bloodpressure samples (minus the one I received in Syncing state). So suddenly I'm processing 1500 samples, instead of a number of batches of 50!This is happening on ONLY one phone. What can be the problem? If this is happening to my phone, then it can also happen to my customer's phones. So I have to get to the bottom of this.Did I mess up the anchor system that Apple employs? Is there any way to reset that anchoring system (other than reinstall Apple Health)?My phone is an iPhone 8 Plus, running iOS 12.1.4, and using Xcode 10.2.So to make it clear: it works fine in the simulator, it works fine on another phone, and it USED to work fine on my own phone. But it's now messed up on my own phone.Any help is appreciated. Even speculation.Cheers!Peter
Posted Last updated
.