Search code examples
flutterdartgoogle-oauthgoogle-fit

Google Fit Oauth stuck in loading


I'm using Google Fit in my app to read Steps data. I've verified my app from Google Console's Oauth consent screen section for the scopes I'm requesting. Some of the users still see infinite loading on Google Oauth.

The health package I'm using: https://github.com/metaflowltd/flutter_health_fit

I've also used this package but same result: https://pub.dev/packages/health

enter image description here enter image description here


Solution

  • I've fixed by removing the line from the kotlin code, which builds the permission with an extra scope which is not verified for my app.

    brief info about the issue I've faced:

    If you don't verify your scopes, google fit's oauth page stuck in loading. you may not notice when your app is in testing but if you are in production, that's the case pretty much. I spent 2 months to verify fitness.activity.read scope and that's the only thing I need for my app. Currently this library also adds fitness.body.read request on getFitnessOptions method. I removed that line on my fork and solved the problem.