Cordova SDK Reference
Class CredoAppService
CredoAppService
Represents the bridge between Cordova and native SDK
new CredoAppService()
Method setForceResolvePermissions()
setForceResolvePermissions()
This method is designed to manage permission behavior on iOS.
If it is determined to be true, the SDK will automatically request permissions; otherwise, the SDK will not request permissions.
service.setForceResolvePermissions(false)
Parameters:
Name | Description | Type |
---|---|---|
| If The default value is |
|
IosMusicModule
Even when the value is set to false, the Music permission (
NSAppleMusicUsageDescription
inIosMusicModule
module) will be automatically requested by the SDK when data is requested.
Method setIgnorePermissions()
setIgnorePermissions()
This method is designed to manage permission behavior on Android.
- The method sets if SDK should prevent the run of
collectAsync()
if permissions aren't granted. - The
true
value allows collecting dataset even if not all permissions are granted. - The
false
value restricts collecting dataset from running until all permissions are granted (including normal permissions). - The default value is
true
service.setIgnorePermissions(false)
Parameters:
Name | Description | Type |
---|---|---|
| The The default value is |
|
Method addModuleAsync()
addModuleAsync()
The method adds a module to the CredoAppService configuration.
await service.addModuleAsync(new SampleModule())
Parameters:
Name | Description | Type |
---|---|---|
| Represents platform module |
|
Returns:
Type | Description |
---|---|
Promise | Returns Promise object |
Method collectAsync()
collectAsync()
Collects data from the phone and returns locally.
await collectAsync()
Returns:
Type | Description |
---|---|
Promise<String> | Returns JSON dataset in compressed string format if collect action is succeeded or error with code and message |
Error Codes
Status Code | Reason | Description |
---|---|---|
30 | Duplicated areas error | The extracting areas are duplicated. |
90 | Unknown error | An unexpected error occurred. |
Updated 11 days ago