I have a Xamarin Forms app that's been on the App Store since early 2018 (nearly 2 years now) and Apple rejected an update yesterday claiming that the app uses HealthKit and that's not the primary function, so I should remove it. You know where this is going: the app does not use HealthKit.
I did my due diligence but the ONLY answer I can find online is that I should do waht I'm already doing: set the linker to Link Framework SDKs Only. That is how building this app has worked since the beginning. It's already that way.
So what I want to do is create an XML file with additional linker options based on this doc:
http://docs.go-mono.com/?link=man:mtouch(1)
Seems like I could set a namespace and Preserve="none" and make my problem go away. The problem is that I don't know (and can't figure out) what assembly contains HealthKit. Can anybody answer that?
Figured out how to answer my own question. Here's the XML file I used:
<?xml version="1.0" encoding="UTF-8" ?> <linker> <assembly fullname="Xamarin.iOS"> <type fullname="HealthKit" preserve="none"/> </assembly> </linker>
The best news out of this is that it actually worked, too. No more HealthKit references. I verified this by extracting the IPA file and running:
strings <> | grep Health
All you should see is this:
applicationShouldRequestHealthAuthorization:
And that's it.
Answers
Figured out how to answer my own question. Here's the XML file I used:
The best news out of this is that it actually worked, too. No more HealthKit references. I verified this by extracting the IPA file and running:
strings <> | grep Health
All you should see is this:
applicationShouldRequestHealthAuthorization:
And that's it.
@BenjaminFunk : I am getting same error and followed the same steps still I could see heath kit strings in the IPA. Pls share exact mtouch argument command so that I can verify it.
@BenjaminFunk : I have tried few steps:
1. using --linkskip="Healthkit" in additional mono touch arguement ios build settings
2. using custom linker configuration file similiar like you & using --xml= in mono touch arguement ios build settings
Still Healthkit is getting linked to the final ipa. Pls suggest any solution as my ios app is getting delayed.
I have tried with the same above mentioned steps with the Sample program, but still I could find HealthKit strings, please suggest me with any solution. I have also uploaded the Sample file.