Flutter SDK Reference
Class CredoAppService
CredoAppService
Represents the bridge between Flutter and native SDK.
var service = 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(bool force)
Parameters:
Name | Description | Type |
---|---|---|
force | If true then SDK requests permissions automatically otherwise SDK omits requesting permissions.The default value is true . | bool |
Note
Even when the value is set to false, the Music permission (
NSAppleMusicUsageDescription
inIosMusicModule
module) will be automatically requested by the SDK when related data will be involved.
Method setIgnorePermissions()
setIgnorePermissions()
This method is designed to manage permission behavior on Android.
- The method sets if SDK should prevent the run of
collect()
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 |
---|---|---|
ignorePermissions | The true value allows data collection even if not all permissions are granted. The false value restricts data collection until all permissions (including normal permissions) are granted.The default value is true . | bool |
Method addModule()
addModule()
The method adds a module to the CredoAppService configuration.
await service.addModule(SampleModule());
Parameters:
Name | Description | Type |
---|---|---|
module | Represents platform module | AndroidApplicationModule AndroidCalendarModule AndroidContactModule AndroidAccountModule AndroidImagesModule AndroidIovationModule AndroidAudioModule AndroidVideoModule AndroidSmsModule IosMusicModule IosCalendarEventsModule IosCalendarRemindersModule IosContactsModule IosIovationModule IosMediaModule |
Returns:
Type | Description |
---|---|
Future | Returns Future |
Method collect()
collect()
Collects data from the phone and returns locally.
await service.collect();
Returns:
Type | Description |
---|---|
Future | Returns JSON dataset in compressed string format if collect action is succeeded |
Class CredoappResult
CredoAppResult states for successful operation and contains a value
Field Name | Type | Description |
---|---|---|
value | String | Returns collected data |
isFailure | bool | Returns false if the operation is completed successfully otherwise true. |
message | String | Returns message value if the operation is failed. |
code | String | Returns code value if the operation is failed. |
Error Codes
Status Code | Reason | Description |
---|---|---|
30 | Duplicated areas error | The extracting areas are duplicated. |
90 | Unknown error | Unexpected error occurred. |
91 | The module is not supported | Use a higher plugin version. |
Updated over 1 year ago