Applications & Profiles
Models and methods for managing application profiles — including association, dissociation, sharing, and recovery.
TFApplication
Represents a registered application.
- iOS (Swift)
- Android (Java)
public struct TFApplication {
public typealias ID = Identifier<Self, String>
public let id: ID
public let name: String
public let logo: URL?
public let version: String
public let isFraudReportEnabled: Bool
}
public class TFApplication {
public TFApplication(
String appID,
String name,
String logoURL,
String version,
boolean isFraudReportEnabled
)
public String getAppID()
public String getName()
public String getLogoURL()
public String getVersion()
public boolean isFraudReportEnabled()
}
TFApplicationProfile
Represents a user profile associated with an application.
- iOS (Swift)
- Android (Java)
public struct TFApplicationProfile {
public struct ID: Hashable {
public let applicationProfileId: String
public let applicationID: String
public init(applicationProfileId: String, applicationID: String)
}
public let id: ID
public let name: String
public internal(set) var state: State?
public internal(set) var associationDate: Date?
public internal(set) var taints: [Taint]
public init(
id: ID,
name: String,
publicKey: String,
associationDate: Date? = nil,
taints: [Taint] = []
)
}
public class TFApplicationProfile {
public TFApplicationProfile(
String userID,
String name,
String appID,
String publicKey,
Date associationDate,
List<Taint> taints
)
public Id getId()
public String getUserID()
public String getAppID()
public String getName()
public String getPublicKey()
public Date getAssociationDate()
public List<Taint> getTaints()
public State getState()
/** Returns a combined identifier as "userID:appID". */
public String getGlobalId()
public static final class Id {
public Id(String userId, String appId)
public String getUserId()
public String getAppId()
public String toGlobalId()
}
}
TFApplicationProfile.State
Reflects the current health state of a profile.
- iOS (Swift)
- Android (Java)
public enum TFApplicationProfile.State {
case corrupted
case pendingPropagation
case removed
}
public enum TFApplicationProfile.State {
ACTIVE,
PENDING_PROPAGATION,
REMOVED,
CORRUPTED
}
TFApplicationProfile.Taint
A flag indicating that the profile requires attention.
- iOS (Swift)
- Android (Java)
public enum TFApplicationProfile.Taint: Hashable, Codable {
case needsRevalidation(until: Date)
}
public static class TFApplicationProfile.Taint {
public Taint(TaintType type, Date until)
public TaintType getType()
public Date getUntil()
}
public enum TFApplicationProfile.TaintType {
NEEDS_REVALIDATION
}
TFApplicationProfiles
A collection of application profiles with their associated applications.
- iOS (Swift)
- Android (Java)
public struct TFApplicationProfiles {
public let profiles: [TFApplicationProfile]
public let applications: [TFApplication]
public init(profiles: [TFApplicationProfile], applications: [TFApplication])
/// Returns the application associated with the given profile, if available.
public func applicationForProfile(_ profile: TFApplicationProfile) -> TFApplication?
}
public record TFApplicationProfiles(
List<TFApplicationProfile> profiles,
List<TFApplication> applications
) {
/** Returns the application associated with the given profile, if available. */
public TFApplication applicationForProfile(TFApplicationProfile profile)
}
TFApplicationProfileDevice
Represents a device associated with an application profile.
- iOS (Swift)
- Android (Java)
public struct TFApplicationProfileDevice: Codable {
public typealias KeyIdentifier = Identifier<Self, String>
public var id: KeyIdentifier { key }
public let key: KeyIdentifier
public let name: String
public let manufacturer: String
public let model: String
public let operatingSystem: String
public let operatingSystemVersion: String
public let marketingName: String?
public internal(set) var associationDate: Date?
public internal(set) var isLocked: Bool?
public internal(set) var maskedDeviceIDSHA: String?
}
public class TFApplicationProfileDevice {
public TFApplicationProfileDevice(
String key,
String name,
String manufacturer,
String model,
String operatingSystem,
String operatingSystemVersion,
Date associationDate,
Boolean isLocked,
String marketingName,
String maskedDeviceIDSHA
)
public String getKey()
public String getName()
public String getManufacturer()
public String getModel()
public String getOperatingSystem()
public String getOperatingSystemVersion()
public Date getAssociationDate()
public Boolean getIsLocked()
public String getMarketingName()
public String getMaskedDeviceIDSHA()
}
TFApplicationProfileDevices
Groups all devices associated with a profile into current and others.
- iOS (Swift)
- Android (Java)
public struct TFApplicationProfileDevices {
public let profileID: TFApplicationProfile.ID
public let currentDevice: TFApplicationProfileDevice
public let otherDevices: [TFApplicationProfileDevice]
public init(
profileID: TFApplicationProfile.ID,
currentDevice: TFApplicationProfileDevice,
otherDevices: [TFApplicationProfileDevice]
)
}
public class TFApplicationProfileDevices {
public TFApplicationProfileDevices(
TFApplicationProfile.Id profileId,
TFApplicationProfileDevice currentDevice,
List<TFApplicationProfileDevice> otherDevices
)
public TFApplicationProfile.Id getProfileId()
public TFApplicationProfileDevice getCurrentDevice()
public List<TFApplicationProfileDevice> getOtherDevices()
}
TFProfilesAssociationResult
The result of a profile association or restoration attempt.
- iOS (Swift)
- Android (Java)
public struct TFProfilesAssociationResult {
public struct NotAssociatedProfile {
public let profile: TFApplicationProfile
public let errors: [Error]
}
public let applications: [TFApplication]
public let associatedProfiles: [TFApplicationProfile]
public let notAssociatedProfiles: [NotAssociatedProfile]
public init(
applications: [TFApplication],
associatedProfiles: [TFApplicationProfile],
notAssociatedProfiles: [NotAssociatedProfile]
)
}
// Named TFProfileAssociationResult on Android
public record TFProfileAssociationResult(
List<TFApplication> applications,
List<TFApplicationProfile> associatedProfiles,
List<FailedProfile> notAssociatedProfiles
)
public record FailedProfile(
TFApplicationProfile profile,
List<Error> errors
)
ProfilesDissociationResult
The result of a profile dissociation attempt.
- iOS (Swift)
- Android (Java)
public struct ProfilesDissociationResult {
public struct NotDissociatedProfile {
public let profileID: TFApplicationProfile.ID
public let errors: [Error]
}
public var dissociatedProfilesID: [TFApplicationProfile.ID]
public var notDissociatedProfiles: [NotDissociatedProfile]
public init(
dissociatedProfilesID: [TFApplicationProfile.ID],
notDissociatedProfiles: [NotDissociatedProfile]
)
}
// Named TFProfilesDissociationResponse on Android
public record TFProfilesDissociationResponse(
List<TFApplicationProfile.Id> dissociatedProfilesID,
List<NotDissociatedProfile> notDissociatedProfiles
) {
public record NotDissociatedProfile(TFApplicationProfile.Id profileId, List<Error> errors) {}
}
ProfileAssociationMethod
Describes the method used to associate a new profile.
- iOS (Swift)
- Android (Java)
public enum TrustFactor.ProfileAssociationMethod {
case deeplink(URL)
case code(String)
}
// Named ProfileRegistrationMethod on Android
public enum ProfileRegistrationMethod {
code,
deeplink
}