Post not yet marked as solved
Please help me to find out the below error related to health kit. Sometimes before we have start health kit implementation in our application, so we have enable the health kit setting form identifier(bundle ID) but now we don't need health kit so we remove all the configuration and code related to health kit from our application.
We have summited our app on apple store with some other changes but app rejected from the below error.
Guideline 2.5.1 - Performance - Software Requirements
Your app uses the HealthKit or CareKit APIs but does not indicate integration with the Health app in your app description and clearly identify the HealthKit and CareKit functionality in your app's user interface.
Next Steps
To resolve this issue, please revise your app description to specify that your app integrates with the Health app, and clearly identify the HealthKit functionality in app's user interface to avoid confusion.
Post not yet marked as solved
We are trying to read and write HealthKit clinical
record from our app(Xamarin Forms app) and we are only able to read the clinical record from Health app into our app but not able to write any new data for any clinical record on behalf of the user into Health app.
Getting exception Authorization error
message while request the Writing permission for Health app.
Exception Message: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Authorization to share the following types is disallowed: HKClinicalTypeIdentifierImmunizationRecord
Please look into that and provide the
solution, how we can write any new data for any clinical record into Health
app.
We are waiting for your response as soon as possible.
Note: We have added all configuration related to
access and write clinical record in our project and Apple
Source Code:
NSSet DataTypesToWrite
{
get
{
return NSSet.MakeNSObjectSet<HKSampleType>(new HKSampleType[]
{
HKObjectType.GetClinicalType(HKClinicalTypeIdentifier.ImmunizationRecord)
});
}
}
NSSet DataTypesToRead
{
get
{
return NSSet.MakeNSObjectSet<HKSampleType>(new HKSampleType[]
{
HKObjectType.GetClinicalType(HKClinicalTypeIdentifier.ImmunizationRecord)
});
}
}
public void GetHealthPermission(Action<bool,string> completion)
{
try
{
if (HKHealthStore.IsHealthDataAvailable)
{
HealthStore = new HKHealthStore();
HealthStore.RequestAuthorizationToShare(DataTypesToWrite, DataTypesToRead, (bool authorized, NSError error) =>
{
if (authorized)
{
}
completion(authorized,Convert.ToString(error));
});
}
else
{
completion(false, "Health data is not available.");
}
}
catch (Exception ex)
{
completion(false,ex.Message);
}
}
Getting Error on below line
HealthStore.RequestAuthorizationToShare(DataTypesToWrite, DataTypesToRead, (bool authorized, NSError error) =>