The Google Fit APIs, including the Google Fit REST API, will be deprecated in 2026. As of May 1, 2024, developers cannot sign up to use these APIs.
For instructions on which API or platform to migrate to, visit the Health Connect migration guide. For a comparison of Health Connect with the Google Fit APIs and the Fitbit Web APIs, visit the Health Connect comparison guide.
Learn more about Health Connect and how to integrate with the API.
Disconnect from Google Fit
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
-
Disconnecting from Google Fit revokes granted OAuth permissions, removes recording subscriptions, and sensor registrations.
-
Users should have a "Disconnect from Google Fit" option in your app settings.
-
The
ConfigClient.disableFitmethod is used to disable Google Fit when a user selects this option.
Disconnecting from Google Fit revokes all granted OAuth permissions for your app and removes all recording subscriptions and sensor registrations made by your app.
You need to provide users with a Disconnect from Google Fit option
in your app settings. When users select this option, you can call the
ConfigClient.disableFit
method to disable Google Fit:
Kotlin
Fitness.getConfigClient(this,GoogleSignIn.getAccountForExtension(this,fitnessOptions)) .disableFit() .addOnSuccessListener{ Log.i(TAG,"Disabled Google Fit") } .addOnFailureListener{e-> Log.w(TAG,"There was an error disabling Google Fit",e) }
Java
Fitness.getConfigClient(this,GoogleSignIn.getAccountForExtension(this,fitnessOptions)) .disableFit() .addOnSuccessListener(unused-> Log.i(TAG,"Disabled Google Fit")) .addOnFailureListener(e-> Log.w(TAG,"There was an error disabling Google Fit",e));