Recovery
Create Recovery Code
Client requirements
- iOS (Swift)
- Android (Java)
trustfactorClient.generateRecoveryCode() { result, correlationId in
switch result {
case .success(let recoveryCode):
// save the recovery code safely
case .failure(let error):
// handle errors
}
}
trustfactorClient.generateRecoveryCode(new Result<String, Error>() {
@Override
public void onSuccess(String backupCode ) {
// save the backup code safely
}
@Override
public void onFailure(Error error) {
// handle errors
}
});
Listing profiles from a Recovery Code
- iOS (Swift)
- Android (Java)
trustfactorClient.getProfilesForRecoveryCode(code: <string>) { result, correlationId in
switch result {
case .success(let profiles):
// handle profiles list
case .failure(let error):
// handle errors
}
}
trustfactorClient.getProfilesForRecoveryCode(backupCode: <String>, new Result<TFApplicationProfiles, Error>() {
@Override
public void onSuccess(TFApplicationProfiles result, String correlationId) {
// result type: TFApplicationProfiles
}
@Override
public void onFailure(Error error, String correlationId) {
// handle errors
}
});
Restore profiles from a Recovery Code
Client requirements
- iOS (Swift)
- Android (Java)
trustfactorClient.restoreProfilesForRecoveryCode(code: <string>) { result, correlationId in
switch result {
case .success(let restorationResult):
// handle result
case .failure(let error):
// handle errors
}
}
trustfactorClient.restoreProfilesForRecoveryCode(backupCode: <String>, new Result<TFProfileAssociationResult, Error>() {
@Override
public void onSuccess(TFProfileAssociationResult result, String correlationId) {
// result type: TFProfileAssociationResult
}
@Override
public void onFailure(Error error, String correlationId) {
// handle errors
}
});