iOS SDK Reference
Class CredoAppService.Builder
CredoAppService.Builder
CredoAppService.Builder
is responsible for creating the CredoAppService
class instance
CredoAppService.Builder()
Method CredoAppService.Builder.addModule(module: Module)
CredoAppService.Builder.addModule(module: Module)
addModule(module: Module) : CredoAppService.Builder
The method adds a module to the builder configuration
Parameters:
Name | Description | Type |
---|---|---|
module | Requires one of the following modules | Module |
Returns:
credoapp.CredoAppService.Builder
Method CredoAppService.Builder.setForceResolvePermissions(value)
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:
Name | Description | Type |
---|---|---|
value | Requires Bool value true or false | Bool |
Returns:
credoapp.CredoAppService.Builder
Method CredoAppService.Builder.addPlugin(plugin: Plugin)
CredoAppService.Builder.addPlugin(plugin: Plugin)
addPlugin(plugin: Plugin) : CredoAppService.Builder
The method adds a plugin to the builder configuration
Parameters:
Name | Description | Type |
---|---|---|
plugin | Requires one of the following plugins | Plugin |
Returns:
credoapp.CredoAppService.Builder
Method CredoAppService.Builder.build()
CredoAppService.Builder.build()
build() : CredoAppService
Returns:
configured CredoAppService
instance
Class CredoAppService
CredoAppService
credoapp.CredoAppService
CredoAppService is responsible for capturing a client's digital footprint
Method CredoAppService.collect()
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:
Type | Description |
---|---|
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.Error | Returns an error if something goes wrong. Please refer to the error codes table. |
Class CredoAppResult<T>.Success
CredoAppResult<T>.Success
CredoAppResult.Success
enum states for successful operation and may contain a value
Fields:
Field Name | Type | Description |
---|---|---|
value | T | Returns value of generic type. |
ClassCredoAppResult.Error
CredoAppResult.Error
CredoAppResult.Error
states for operation fail and contains error details
Fields:
Field Name | Type | Description |
---|---|---|
message | String | Returns the message value of the error. |
code | Int | Returns the code value of the error |
Class BehavioralModule
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()
BehavioralModule.startTracking()
startTracking()
- Starts behavioral interaction metadata tracking
Method BehavioralModule.stopTracking()
BehavioralModule.stopTracking()
stopTracking()
- Terminates behavioral metadata tracking
Method BehavioralModule.setLogger(plugin: Plugin)
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 Code | Reason | Description |
---|---|---|
30 | Duplicated areas error | The extracting areas are duplicated. |
90 | Unknown error | An unexpected error occurred. |
Updated almost 2 years ago