Forum Xamarin.iOS

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

What assembly contains HealthKit?

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?

Best Answer

  • BenjaminFunkBenjaminFunk USMember ✭✭
    edited January 2020 Accepted Answer

    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

  • BenjaminFunkBenjaminFunk USMember ✭✭
    edited January 2020 Accepted Answer

    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.

  • AnoshInglesAnoshIngles USMember

    @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.

  • AnoshInglesAnoshIngles USMember

    @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.

  • SrinivasTMSrinivasTM Member ✭✭
    edited February 20

    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.

Sign In or Register to comment.