Search code examples
react-nativeaccounthuawei-mobile-serviceshuawei-developershuawei-account

HUAWEI ID login: Scope email address option getting as unselected


I have implemented @hmscore/react-native-hms-account to my react native application for login with Huawei Id.

When I sign in with an id token, I want to get mandatory the obtain your email address option. But currently, the option is there but default unselected.

I am passing authScopeList: [HMSAuthScopeListConstants.EMAIL] for scope as well.

Is it possible to get obtain your email address as mandatory default selected option?

enter image description here

Thank you.

signInWithIdToken = () => {
  let signInData = {
    accountAuthParams: HMSAuthParamConstants.DEFAULT_AUTH_REQUEST_PARAM,
    authRequestOption: [
      HMSAuthRequestOptionConstants.ID_TOKEN,
      HMSAuthRequestOptionConstants.ACCESS_TOKEN,
    ],
    authScopeList: [HMSAuthScopeListConstants.EMAIL],
  };
  HMSAccountAuthService.signIn(signInData)
    .then((response) => {
      this.logger('Sign In With IdToken -> ', response);
      console.log(response);
    })
    .catch((err) => {
      this.errorLogger('Sign In With IdToken -> ', err);
    });
};

Solution

  • As confirmed by the team, the email address is the user's personal privacy information. So user needs to choose whether to authorize the email address.

    Therefore, this option is not selected by default and cannot be mandatory default selected option.