Disconnect from Google Fit

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 should provide users with a Disconnect from Google Fit option in your app settings.

Disable Google Fit

To disable Google Fit, call the ConfigApi.disableFit method when users tap the Disconnect from Google Fit option in your app:

// 1. Invoke the Config API with the Google API client object
PendingResult<Status> pendingResult = ConfigApi.disableFit(mClient);

// 2. Check the result (see other examples)

In order to call ConfigApi.disableFit, your app must add Fitness.CONFIG_API when connecting to the GoogleApiClient, as shown in the following example:

GoogleApiClient mClient = new GoogleApiClient.Builder(context)

See Get Started for more details.

Send feedback about...