User Information Modification
i. Change Local Authentication Type
API : BSA.APICaller.changeLocalAuthType
swift
BSA.APICaller.changeLocalAuthType(authType: .BIOMETRIC, onSuccess: {
// Modification Successful
// Check Modified Values
let localAuthType = BSA.loadLocalAuthType() ?? .UNKNOWN
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.changeLocalAuthType(authType: BSA.Enums.LocalAuthType,
onSuccess: @escaping () -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
authType | BSA.Enums.LocalAuthType | Local Authentication Type to be changed. |
onSuccess | () -> () | Called on success |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- Change the user's default Local Authentication Type.
- The user's default Local Authentication Type can be determined by calling
BSA.loadLocalAuthType()
after invoking this function.
ii. Unregister Device
API : BSA.APICaller.requestDeregisterDevice
swift
guard let userKey = BSA.loadUserKey() else {
return
}
BSA.APICaller.requestDeregisterDevice(userKey: userKey,
onSuccess: {
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.requestDeregisterDevice(userKey: String,
onSuccess: @escaping () -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag )
Parameter | Type | Description |
---|---|---|
userKey | String | UserID |
onSuccess | () -> () | Called on success |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- This should be called when Access Token is issued.
- When Unregister Device is performed, all user data stored is deleted.
- TOTP Key
- DeviceID
- AccessToken
- LocalAuthType
- FCMToken
- UserKey
iii. Delete Account
API : BSA.APICaller.requestDeleteAccount
swift
BSA.APICaller.requestDeleteAccount(onSuccess: {
// Successful Invocation
}, onTokenExpired: { [weak self] rtCode, resultMessage in
// Token Expired
}, onFailed: { [weak self] rtCode, resultMessage in
// Invocation Failure
}, onError: { [weak self] error in
// Invocation Error
}, onTotalLog: { text in
// Invocation Log
}, onCompleted: {
// invocation completed
}, disposeBag: disposeBag)
Parameters
swift
BSA.APICaller.requestDeleteAccount(onSuccess: @escaping () -> (),
onTokenExpired: @escaping BSA.APICaller.OnTokenExpired,
onFailed: @escaping OnFailed,
onError: @escaping OnError,
onTotalLog: @escaping OnTotalLog? = nil,
onCompleted: @escaping onCompleted? = nil,
disposeBag: DisposeBag
Parameter | Type | Description |
---|---|---|
onSuccess | () -> () | Called on success. |
onTokenExpired | onTokenExpired | Function called when token expires. Same format as onFailed |
onFailed | OnFailed | Callback function called on API processing failure. |
onError | OnError | Callback function called on error. |
onTotalLog | OnTotalLog | Callback function to receive all logs generated during API calls. |
onCompleted | onCompleted | Called at the end after all processes are completed. |
disposeBag | DisposeBag | DisposeBag variable to manage RxSwift Disposable objects. |
Description
- This should be called when Access Token is issued.
- When Delete Account is performed, all user data stored is deleted.
- TOTP Key
- DeviceID
- AccessToken
- LocalAuthType
- FCMToken
- UserKey