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
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
when connecting to the
GoogleApiClient, as shown in the following example:
GoogleApiClient mClient = new GoogleApiClient.Builder(context) .addApi(Fitness.CONFIG_API) ... .build(); client.connect();
See Get Started for more details.