0
0

More than 3 years have passed since last update.

Android端末におけるHUAWEI IDログイン機能の詳細実装手順6-HMS端末で権限取り消し

Last updated at Posted at 2021-04-01

Android SDKによる権限取り消し機能の実装方法

1.HUAWEI ID認証サービスのcancelAuthorization()を使って権限を取り消します。
2.処理結果のコールバックをaddOnCompleteListener()で追加すれば、権限取り消し結果(isSuccessful)を受け取れます。

HmsHuaweiIdLogic.kt
override fun cancelAuthorization(context: Context) {
    authManager?.let {
        it.cancelAuthorization().addOnCompleteListener { task ->
            if (task.isSuccessful) {
                // 権限取り消しが成功したときの処理
            } else {
                // 権限取り消しが失敗したときの処理
            }
        }
    }
}

シリーズ

GitHub

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0