revokePermissions

actual suspend fun revokePermissions(): Boolean

Revokes all previously granted permissions for accessing health data.

This function attempts to remove all permissions that the application has been granted for accessing health and fitness data. This is useful if the user wishes to stop the application from accessing their health information.

Note: The exact behavior of this function may vary depending on the underlying platform and its permission management system. Some platforms might not support programmatic revocation of all permissions.

Return

true if all permissions were successfully revoked (or if no permissions were granted initially), false if the revocation failed for one or more permissions or if the platform does not support this operation.

Throws

if an unexpected error occurs during the permission revocation process.

Android (Kotlin)

lifecycleScope.launch {
try {
val revoked = AFCore.healthTracking().revokePermissions()
if (revoked) showMessage("Health access removed") else showError("Could not revoke access")
} catch (t: Throwable) {
showError("Failed to revoke health permissions: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let revoked = try await AFCore.shared.healthTracking().revokePermissions()
revoked ? self.showMessage("Health access removed")
: self.showError("Could not revoke access")
} catch {
self.showError("Failed to revoke health permissions: \\(error.localizedDescription)")
}
}
actual suspend fun revokePermissions(): Boolean

Revokes all previously granted permissions for accessing health data.

This function attempts to remove all permissions that the application has been granted for accessing health and fitness data. This is useful if the user wishes to stop the application from accessing their health information.

Note: The exact behavior of this function may vary depending on the underlying platform and its permission management system. Some platforms might not support programmatic revocation of all permissions.

Return

true if all permissions were successfully revoked (or if no permissions were granted initially), false if the revocation failed for one or more permissions or if the platform does not support this operation.

Throws

if an unexpected error occurs during the permission revocation process.

Android (Kotlin)

lifecycleScope.launch {
try {
val revoked = AFCore.healthTracking().revokePermissions()
if (revoked) showMessage("Health access removed") else showError("Could not revoke access")
} catch (t: Throwable) {
showError("Failed to revoke health permissions: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let revoked = try await AFCore.shared.healthTracking().revokePermissions()
revoked ? self.showMessage("Health access removed")
: self.showError("Could not revoke access")
} catch {
self.showError("Failed to revoke health permissions: \\(error.localizedDescription)")
}
}
actual suspend fun revokePermissions(): Boolean

Revokes all previously granted permissions for accessing health data.

This function attempts to remove all permissions that the application has been granted for accessing health and fitness data. This is useful if the user wishes to stop the application from accessing their health information.

Note: The exact behavior of this function may vary depending on the underlying platform and its permission management system. Some platforms might not support programmatic revocation of all permissions.

Return

true if all permissions were successfully revoked (or if no permissions were granted initially), false if the revocation failed for one or more permissions or if the platform does not support this operation.

Throws

if an unexpected error occurs during the permission revocation process.

Android (Kotlin)

lifecycleScope.launch {
try {
val revoked = AFCore.healthTracking().revokePermissions()
if (revoked) showMessage("Health access removed") else showError("Could not revoke access")
} catch (t: Throwable) {
showError("Failed to revoke health permissions: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let revoked = try await AFCore.shared.healthTracking().revokePermissions()
revoked ? self.showMessage("Health access removed")
: self.showError("Could not revoke access")
} catch {
self.showError("Failed to revoke health permissions: \\(error.localizedDescription)")
}
}