Andrey Sorokin
Andrey Sorokin

Reputation: 177

Flutter Health package Apple Health iOS PermissionStatus.permanentlyDenied

Hi I am using the Health package version 6.0.0 in my Flutter app to write data to Apple Health or Google Fit. I was able to get it working on Android Goodle Fit with no issues. However, the Apple part is not flying at all, sadly.

When the app launches for the first time on iOS simulator it is asking the user for other permissions, but not Health Kit, which is not showing at all.

I request the permission to Apple Health as follows:

final PermissionStatus permissionStatus =
      await Permission.activityRecognition.request();

Permission request always returns PermissionStatus.permanentlyDenied on Apple Health iOS simulator (it works fine on Android Google Fit). I cannot add my app from the Apple Health settings either as the app list section in the Apple Health settings is greyed out.

I did append the Info.plist with the required 2 entries:

<key>NSHealthShareUsageDescription</key>
<string>We will sync your data with the Apple Health app to give you better insights</string>
<key>NSHealthUpdateUsageDescription</key>
<string>We will sync your data with the Apple Health app to give you better insights</string>

I did enable Health Kit capabilities in XCode (14.2) in debug, profile, release and all tabs.

XCode screenshot

What am I missing?

Upvotes: 3

Views: 833

Answers (0)

Related Questions