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) throws
Parameters
storage
StoreClient object
-
Sets default SDK’s PolicyEvaluator
Throws
FRAErrorDeclaration
Swift
public static func setPolicyEvaluator(policyEvaluator: FRAPolicyEvaluator) throws
Parameters
policyEvaluator
FRAPolicyEvaluator 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
identifier
identifier 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 -> Bool
Parameters
account
Account 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) -> Bool
Parameters
account
Account object to be removed
Return Value
Boolean result of deleting operation
-
Lock the given
Account
object limiting the access to allMechanism
objects and anyPushNotification
objects associated with it.Throws
AccountErrorDeclaration
Parameters
account
Account object to be locked
policy
The 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
notification
PushNotification 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) -> Bool
Parameters
mechanism
Mechanism 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
mechanism
PushMechanism 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
mechanism
PushMechanism 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
identifier
String 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) -> Bool
Parameters
notification
PushNotification 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
uri
URL of QR Code
onSuccess
success completion callback with Mechanism
onError
failure callback with Error