Google Fit REST API を含む Google Fit API は、2026 年に非推奨になります。2024 年 5 月 1 日より、デベロッパーはこれらの API の使用を登録できなくなります。
移行先の API またはプラットフォームの手順については、ヘルスコネクトの移行ガイドをご覧ください。ヘルスコネクトと Google Fit API および Fitbit Web API の比較については、ヘルスコネクトの比較ガイドをご覧ください。
ヘルスコネクトの詳細と API との統合方法をご覧ください。
Google Fit との接続を解除する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Fit との接続を解除すると、アカウントに付与されている OAuth 権限がすべて取り消されます
記録サブスクリプションとセンサー登録がすべて削除されます。
説明します。
アプリの設定で、ユーザーに [Google Fit との接続を解除] オプションを提供する必要があります。ユーザーがこのオプションを選択すると、
ConfigClient.disableFit
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));
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\u003cp\u003eDisconnecting from Google Fit removes all app permissions, data recording subscriptions, and sensor registrations.\u003c/p\u003e\n"],["\u003cp\u003eApps need to provide a "Disconnect from Google Fit" option, triggering the \u003ccode\u003eConfigClient.disableFit()\u003c/code\u003e method for disconnection.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eConfigClient.disableFit()\u003c/code\u003e revokes Google Fit access and stops data collection by the app.\u003c/p\u003e\n"]]],[],null,["# Disconnect from Google Fit\n\nDisconnecting from Google Fit revokes all granted OAuth permissions for your\napp and removes all recording subscriptions and sensor registrations made by\nyour app.\n\nYou need to provide users with a **Disconnect from Google Fit** option\nin your app settings. When users select this option, you can call the\n[`ConfigClient.disableFit`](/android/reference/com/google/android/gms/fitness/ConfigClient#public-taskvoid-disablefit)\nmethod to disable Google Fit: \n\n### Kotlin\n\n```kotlin\nFitness.getConfigClient(this, GoogleSignIn.getAccountForExtension(this, fitnessOptions))\n .disableFit()\n .addOnSuccessListener {\n Log.i(TAG,\"Disabled Google Fit\")\n }\n .addOnFailureListener { e -\u003e\n Log.w(TAG,\"There was an error disabling Google Fit\", e)\n }\n```\n\n### Java\n\n```java\nFitness.getConfigClient(this, GoogleSignIn.getAccountForExtension(this, fitnessOptions))\n .disableFit()\n .addOnSuccessListener(unused -\u003e\n Log.i(TAG, \"Disabled Google Fit\"))\n .addOnFailureListener(e -\u003e\n Log.w(TAG, \"There was an error disabling Google Fit\", e));\n```"]]