registerCredentialsWithToken static method
Register a Credential with a rendezvous token.
Use this function to register a Credential from one device to another. NOTE: only one credential per device is currently supported.
token
is a rendezvous token received during the export flow initiated
by calling extendCredentials.
Returns the list of credentials registered.
Implementation
static Future<List<Credential>> registerCredentialsWithToken(String token) async {
List<dynamic>? credentialListMap = await _channel.invokeListMethod('registerCredentialsWithToken', {
'token': token,
});
List<Credential> credentialList = List.empty(growable: true);
if (credentialListMap != null) {
try {
credentialList = credentialListMap.map((cred) => Credential.mapToCredential(cred)).toList();
} on Exception {
rethrow;
}
} else {
throw Exception("Error getting credentials from platform");
}
return credentialList;
}