OYIon / LiveXAML

Xamarin Forms live UI update in an emulator
35 stars 2 forks source link

Unwanted HealthKit Reference with Xamarin.Forms (iOS) #80

Open patrickluk opened 5 years ago

patrickluk commented 5 years ago

I am using LiveXAML in my iOS app for more than a year already. I don't have HealthKit references in the app, and I am not using any HealthKit features. The app can deployed to the App Store as usual. Since Xamarin.Forms got updated (in the past 3-4 months), My app got rejected by the App Store due to unwanted HealthKit reference.

I tried to remove LiveXAML from my project, and the app is built without any HealthKit references. I thought that the unwanted HealthKit reference was from the latest LiveXAML updates, so I tried to add an old version (from February 2018) of LiveXAML back to my project, but this time the app is built with HealthKit references.

Seems like the unwanted HealthKit references is an issue with the latest Xamarin.Forms update.

patrickluk commented 5 years ago

To check whether the app has healthkit references or not, I performed the following steps (on a Mac computer):

  1. Navigate to the directory that contains [your-app-name].ipa
  2. Extract files by opening [your-app-name].ipa with a zip reader. That creates a "Payload" directory in the current directory
  3. Navigate to the extracted app folder: $ cd Payload/[your-app-name].iOS.app/
  4. Analyze HealthKit related strings in the build: $ strings [your-app-name].iOS | grep Health

If the app contains HealthKit Reference, I am seeing these lines after executing $ strings [your-app-name].iOS | grep Health:

applicationShouldRequestHealthAuthorization:
HealthKitUI_HKActivityRingView_HKActivityRingViewAppearance
HKHealthStore
HealthKitUI_HKActivityRingView_HKActivityRingViewAppearance
isHealthDataAvailable
supportsHealthRecords
initWithHealthStore:quantityType:startDate:device:
initWithHealthStore:configuration:device:
initWithHealthStore:device:
applicationShouldRequestHealthAuthorization:

If there is no HealthKit references, I will see this instead:

applicationShouldRequestHealthAuthorization:
ionoy commented 5 years ago

Hello @lukpwh330

There are no references to HealthKit from LiveXAML. Also, to completely remove LiveXAML from your build you can add a DISABLE_XAMARINFORMSLIVE compilation symbol.

amirvenus commented 5 years ago

I highly doubt this is an issue with LiveXAML as I had another app which never used LiveXAML and reported the same false reference!

bigbulloz commented 2 years ago

Hi @patrickluk How did you solve this problem?