getProfileUserInfo method

Future<ProfileUserInfo> getProfileUserInfo(
  1. ProfileDetails? details
)

Retrieves email address and obfuscated gaia id of the user signed into a profile.

Requires the identity.email manifest permission. Otherwise, returns an empty result.

This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.

|details|: Profile options. |callback|: Called with the ProfileUserInfo of the primary Chrome account, of an empty ProfileUserInfo if the account with given details doesn't exist.

Implementation

Future<ProfileUserInfo> getProfileUserInfo(ProfileDetails? details) async {
  var $res = await promiseToFuture<$js.ProfileUserInfo>(
      $js.chrome.identity.getProfileUserInfo(details?.toJS));
  return ProfileUserInfo.fromJS($res);
}