Skip to content

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 )
ParameterTypeDescription
authTypeBSA.Enums.LocalAuthTypeLocal Authentication Type to be changed.
onSuccess() -> ()Called on success
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag 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 )
ParameterTypeDescription
userKeyStringUserID
onSuccess() -> ()Called on success
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag 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
ParameterTypeDescription
onSuccess() -> ()Called on success.
onTokenExpiredonTokenExpiredFunction called when token expires. Same format as onFailed
onFailedOnFailedCallback function called on API processing failure.
onErrorOnErrorCallback function called on error.
onTotalLogOnTotalLogCallback function to receive all logs generated during API calls.
onCompletedonCompletedCalled at the end after all processes are completed.
disposeBagDisposeBagDisposeBag 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