Association details
You can retrieve Application and Profile details before proceeding to the association.
The response also tells you whether the code requires a precise location
(TFApplicationProfiles.requiresPreciseLocation on iOS, TFApplicationProfiles.requiresPreciseLocation() on
Android). This is TrustFactor's own answer, so it is the one to trust —
read it here and ask the user for the location permission while they are still on the enrollment screen, before
associating the profile.
caution
Not all association codes are valid, in that case, a Error with domain profileAction(code: .invalidAssociationCode) is returned. The same association method can still be valid for the association method.
Client requirements
Using link
- iOS (Swift)
- Android (Java)
let url = URL(string: "https://....")
trustfactorClient.applicationProfileForAssociation(method: .deeplink(url)) { result, correlationId in
switch result {
case .success(let response):
// response type: TFApplicationProfiles
case .failure(let error):
// handle errors
}
}
Uri uri = Uri.parse("https://....");
trustfactorClient.applicationProfileForAssociation(uri, (result) -> result.fold(
(TFApplicationProfiles profiles, String correlationId) -> {
// handle success
},
(Error error, String correlationId) -> {
// handle errors
}
));
Using an association code
- iOS (Swift)
- Android (Java)
let code = "....."
trustfactorClient.applicationProfileForAssociation(method: .code(code)) { result, correlationId in
switch result {
case .success(let response):
// response type: TFApplicationProfiles
case .failure(let error):
// handle errors
}
}
String code = "<>";
trustfactorClient.applicationProfileForAssociation(code, (result) -> result.fold(
(TFApplicationProfiles profiles, String correlationId) -> {
// handle success
},
(Error error, String correlationId) -> {
// handle errors
}
));