0

I'm going to use the flutter health package to get step data. But I can't get permission from Gmail for my app by using this method. I have already added test users to the Google console in the GCP project.

Any solution?

Daham Akalanka
  • 295
  • 1
  • 10

1 Answers1

0

you have to add ACTIVITY_RECOGNITION for getting STEP Count permission in AndroidManifest.xml.

<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

And then using permission_handler ask for permission.

    if (Platform.isAndroid) {
  final permissionStatus = Permission.activityRecognition.request();
  if (await permissionStatus.isDenied ||
      await permissionStatus.isPermanentlyDenied) {
    showToast(
        'activityRecognition permission required to fetch your steps count');
    return;
  }
}
G H Prakash
  • 1,720
  • 10
  • 30
  • Yes, I already did it. – Daham Akalanka Oct 07 '21 at 05:01
  • You need to add the SHA finger print first in api console. You will get the SHA using a keystore file, Later on you need to test via the signed apk via that keystore file. Remember: You need to add the testing email as well in google api console if the app is not in production. – Muhammad Bilal ahmad Oct 05 '22 at 13:35