flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

HEALTH 8.0.0 Quota Limit Exceeded

Open Kam5678 opened this issue 2 years ago • 3 comments

So currently I am running into the following issue for android whenever I try to fetch health data(Steps, HeartRate, Sleep_Session, Sleep_Awake)

E/AndroidRuntime(13306): android.os.RemoteException: Request rejected. Rate limited request quota has been exceeded. Please wait until quota has replenished before making further requests.
E/AndroidRuntime(13306): 	at androidx.health.platform.client.impl.error.ErrorStatusConverterKt.toException(ErrorStatusConverter.kt:49)
E/AndroidRuntime(13306): 	at androidx.health.platform.client.impl.ReadDataRangeCallback.onError(ReadDataRangeCallback.kt:35)
E/AndroidRuntime(13306): 	at androidx.health.platform.client.service.IReadDataRangeCallback$Stub.onTransact(IReadDataRangeCallback.java:75)
E/AndroidRuntime(13306): 	at android.os.Binder.execTransactInternal(Binder.java:1195)
E/AndroidRuntime(13306): 	at android.os.Binder.execTransact(Binder.java:1159)
E/AndroidRuntime(13306): 	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@a816b6d, Dispatchers.Main]

https://developer.android.com/guide/health-and-fitness/health-connect-guidelines/rate-limiting) I honestly just wanted some guidance because I don't think this problem is related to the package, but more with the amount of API calls I can make when fetching data through healthconnect. But currently using this package I think all I can do is make these API calls to get data(Possible solution would be to minimize calls and save data to a database I think?)

https://developer.android.com/guide/health-and-fitness/health-connect/common-workflows/sync-data#pull-data In order to minmize API calls android suggests using something called changelog handling which utilizes healthConnectClient and a function called getChangesToken(healthConnectClient.getChangesToken(..) to check if there were any changes in data, which I can then use to update my database data whenever there are changes. But I believe currently this health package doesn't support that?

Or honestly if there is any other possible solution you would suggest, since this issue right now causes my whole app to crash whenever I get this error.

Would honestly appreciate any guidance!

Kam5678 avatar Aug 17 '23 19:08 Kam5678