התנתקות מ-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));
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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```"]]