I am integrating Huawei account kit. I want to know whether the AccessToken can be obtained through authAccount by using the following code:
private void silentSignIn() {
Task<AuthAccount> task = mAuthManager.silentSignIn();
task.addOnSuccessListener(new OnSuccessListener<AuthAccount>() {
@Override
public void onSuccess(AuthAccount authAccount) {
Log.i(TAG, "silentSignIn success");
Log.i(TAG, "touxiang: "+authAccount.getAvatarUriString());
}
});
task.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
//if Failed use getSignInIntent
if (e instanceof ApiException) {
ApiException apiException = (ApiException) e;
signIn();
}
}
});
}
Could anyone give any clue?
