FRAClient
public class FRAClient : NSObject
FRAuthenticator is an abstraction layer of FRAuthenticator SDK and is responsible to create, and manage Account, and Mechanism objects with StorageClient
-
shared instance of FRAuthenticator after SDK started
Declaration
Swift
public static var shared: FRAClient?
-
Starts SDK’s lifecylce and internal process
Declaration
Swift
public static func start()
-
Sets default SDK’s Storage Client; any storage client that inherits ‘StorageClient’ can be used for SDK’s storage
Throws
FRAErrorDeclaration
Swift
public static func setStorage(storage: StorageClient) throwsParameters
storageStoreClient object
-
Sets default SDK’s PolicyEvaluator
Throws
FRAErrorDeclaration
Swift
public static func setPolicyEvaluator(policyEvaluator: FRAPolicyEvaluator) throwsParameters
policyEvaluatorFRAPolicyEvaluator object
-
Retrieves all Account objects from given StorageClient
Declaration
Swift
public func getAllAccounts() -> [Account]Return Value
An array of Account; empty array is returned when there is no Account
-
Retrieves a specific Account object with given identifier; identifier as in “
- format” Declaration
Swift
public func getAccount(identifier: String) -> Account?Parameters
identifieridentifier of Account object as in “
- format” Return Value
Account object for given identifier
-
Update given Account object on the StorageClient
Throws
AccountErrorDeclaration
Swift
@discardableResult public func updateAccount(account: Account) throws -> BoolParameters
accountAccount object to be updated
Return Value
Boolean result of deleting operation
-
Removes given Account object from given StorageClient
Declaration
Swift
@discardableResult public func removeAccount(account: Account) -> BoolParameters
accountAccount object to be removed
Return Value
Boolean result of deleting operation
-
Lock the given
Accountobject limiting the access to allMechanismobjects and anyPushNotificationobjects associated with it.Throws
AccountErrorDeclaration
Parameters
accountAccount object to be locked
policyThe non-compliance policy
Return Value
Boolean result of lock operation
-
Retrieves a PushMechanism object with given PushNotification object
Note: This getMechanism with PushNotification object does not retrieve all PushNotification object associated with PushMechanism. This only returns PushMechanism object without the array.
Declaration
Swift
public func getMechanism(notification: PushNotification) -> PushMechanism?Parameters
notificationPushNotification object
Return Value
PushMechanism object for given PushNotification
-
Removes Mechanism object from StorageClient, and all associated PushNotification objects if needed
Declaration
Swift
@discardableResult public func removeMechanism(mechanism: Mechanism) -> BoolParameters
mechanismMechanism object to be removed
Return Value
boolean result of operation
-
Retrieves an array of PushNotification objects that is associated with given PushMechanism
Declaration
Swift
public func getAllNotifications(mechanism: PushMechanism) -> [PushNotification]Parameters
mechanismPushMechanism object to retrieve all notifications
Return Value
An array of PushNotification that given PushMechanism received
-
Retrieves an array of PushNotification objects across all PushMechanisms
Declaration
Swift
public func getAllNotifications() -> [PushNotification]Parameters
mechanismPushMechanism object to retrieve all notifications
Return Value
An array of PushNotification
-
Retrieves PushNotification object with given PushNotification Identifier; Identifier of PushNotification object is “
- ” Declaration
Swift
public func getNotification(identifier: String) -> PushNotification?Parameters
identifierString value of PushNotification object’s identifier as in “
- ” Return Value
PushNotification object with given identifier
-
Removes PushNotification object from StorageClient
Declaration
Swift
@discardableResult public func removeNotification(notification: PushNotification) -> BoolParameters
notificationPushNotification object to be removed
Return Value
boolean result of operation
-
Parses given QR Code URL into Account, and Mechanism object, and stores them into StorageClient if saving both Account and Mechanism objects was successful. If Account already exists, and QR Code is storing new Mechanism object, SDK only stores Mechanism object, and ignores Account object
Declaration
Swift
public func createMechanismFromUri(uri: URL, onSuccess: @escaping MechanismCallback, onError: @escaping ErrorCallback)Parameters
uriURL of QR Code
onSuccesssuccess completion callback with Mechanism
onErrorfailure callback with Error
View on GitHub