These docs are for v2.6. Click to read the latest docs for v3.1.

iOS SDK Reference

Class CredoAppService.Builder

CredoAppService.Builder is responsible for creating the CredoAppService class instance

CredoAppService.Builder()

Method CredoAppService.Builder.addModule(module: Module)

addModule(module: Module) : CredoAppService.Builder

The method adds a module to the builder configuration

Parameters:

NameDescriptionType
moduleRequires one of the following modulesModule

Returns:

credoapp.CredoAppService.Builder


Method CredoAppService.Builder.setForceResolvePermissions(value)

setForceResolvePermissions(force: Bool) : CredoAppService.Builder

  • If true then SDK requests permissions automatically otherwise, SDK omits requesting permissions
  • The default value is true

Parameters:

NameDescriptionType
valueRequires Bool value true or falseBool

Returns:

credoapp.CredoAppService.Builder


Method CredoAppService.Builder.addPlugin(plugin: Plugin)

addPlugin(plugin: Plugin) : CredoAppService.Builder

The method adds a plugin to the builder configuration

Parameters:

NameDescriptionType
pluginRequires one of the following pluginsPlugin

Returns:

credoapp.CredoAppService.Builder


Method CredoAppService.Builder.build()

build() : CredoAppService

Returns:

configured CredoAppService instance



Class CredoAppService

credoapp.CredoAppService CredoAppService is responsible for capturing a client's digital footprint

Method CredoAppService.collect()

collect() : CredoAppResult<String>
  • Collects from the device and returns locally
  • This method must not be called on the UI thread
  • It does not accept any parameters

Returns:

TypeDescription
CredoAppResult<String>If the collect method is succeeded, returns the string, which represents the array of bytes that is encoded to the base64 string
CredoAppResult.ErrorReturns an error if something goes wrong.
Please refer to the error codes table.



Class CredoAppResult<T>.Success

CredoAppResult.Success enum states for successful operation and may contain a value

Fields:

Field NameTypeDescription
valueTReturns value of generic type.



ClassCredoAppResult.Error

CredoAppResult.Error states for operation fail and contains error details

Fields:

Field NameTypeDescription
messageStringReturns the message value of the error.
codeIntReturns the code value of the error



Class BehavioralModule

BehavioralModule

BehavioralModule is responsible for capturing a client's behavioral interaction with UI and OS.
The special module is responsible for observing and extracting in-app user behavior data. Tracking must be initiated manually. The module doesn’t compatible with Swift UI tooling.


Method BehavioralModule.startTracking()

startTracking()
  • Starts behavioral interaction metadata tracking

Method BehavioralModule.stopTracking()

stopTracking()
  • Terminates behavioral metadata tracking

Method BehavioralModule.setLogger(plugin: Plugin)

setLogger(plugin: Plugin)
  • Accepts LoggingPlugin() to log any errors that may occur while event tracking

How to use BehavioralModule

class ViewController: UIViewController {
     
	override func viewDidLoad() {
    super.viewDidLoad()
    BehavioralModule.setLogger(plugin: LoggingPlugin())
    BehavioralModule.startTracking()
    ...
    
	}	
    func stopTracking() {
   // calling stopTracking() method is optional
    BehavioralModule.stopTracking()
 }
}

Error Codes

Status CodeReasonDescription
30Duplicated areas errorThe extracting areas are duplicated.
90Unknown errorAn unexpected error occurred.