iOS SDK Reference
Class CredoAppService.Builder
CredoAppService.BuilderCredoAppService.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.BuilderThe 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
truethen 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.BuilderThe 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() : CredoAppServiceReturns:
configured CredoAppService instance
Class CredoAppService
CredoAppServicecredoapp.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 |
|---|---|
| If the |
| Returns an error if something goes wrong. |
Class CredoAppResult<T>.Success
CredoAppResult<T>.SuccessCredoAppResult.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.ErrorCredoAppResult.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
BehavioralModuleBehavioralModuleBehavioralModule 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 6 months ago
