Integration
The minimal supported version of Cordova is 6.0.0
or higher
The minimal supported iOS version is 11.0
or higher
The minimal supported Android API version is 21
or higher
If iOS Iovation plugin is used then the minimum supported iOS version is
12.0
or higher
1. Install dependencies
Add .npmrc
file at the root level of the project with the path to the plugin repository
@credolab:registry=https://npm.cloudsmith.io/credolab/hybrid/
Install the plugins to your project
cordova plugin add @credolab/[email protected]
ionic cordova plugin add @credolab/[email protected]
Note
Please replace
X.Y.Z
with module versions from Cordova SDK page.
The final result should look like this:ionic cordova plugin add @credolab/[email protected]
Add repositories for Android
Open platforms\android\app\repositories.gradle
file and declare the repository:
allprojects {
repositories {
// ...
maven { url "https://dl.cloudsmith.io/$TOKEN/credolab/proxyen-sdk/maven/" }
}
}
Add repositories for iOS
Add the Cocoapods repository to the beginning of the platforms/ios/Podfile
file
source 'https://token:[email protected]/basic/credolab/proxyen-sdk/cocoapods/index.git'
Install Pods
Install pods by executing
pod install
Unable to find a specification for
library_name
?In certain cases you may see the error with similar title during pods installation.
To fix this, please add the following CocoaPods CDN to the Podfilesource 'https://cdn.cocoapods.org/'
2. Build and Use CredoAppService
CredoAppService
In your Cordova app code open the file where theCredoAppService
planned to be used.
Add plugins import
declare var CredoAppService: any
declare var AndroidVideoModule: any;
declare var AndroidImagesModule: any;
declare var AndroidAudioModule: any;
declare var AndroidAccountModule: any;
declare var AndroidCalendarModule: any;
declare var AndroidSmsModule: any;
declare var AndroidIovationModule: any;
declare var AndroidApplicationModule: any;
declare var AndroidContactModule: any;
declare var IosCalendarEventsModule: any;
declare var IosCalendarRemindersModule: any;
declare var IosContactModule: any;
declare var IosMusicModule: any;
declare var IosMediaModule: any;
declare var IosIovationModule: any;
Build CredoAppService
with required modules
const credoapp = new CredoAppService()
await credoapp.addModuleAsync(new IosCalendarEventsModule())
await credoapp.addModuleAsync(new IosCalendarRemindersModule())
await credoapp.addModuleAsync(new IosContactModule())
await credoapp.addModuleAsync(new IosIovationModule())
await credoapp.addModuleAsync(new IosMediaModule())
await credoapp.addModuleAsync(new IosMusicModule())
await credoapp.addModuleAsync(new AndroidVideoModule())
await credoapp.addModuleAsync(new AndroidImagesModule())
await credoapp.addModuleAsync(new AndroidAudioModule())
await credoapp.addModuleAsync(new AndroidAccountModule())
await credoapp.addModuleAsync(new AndroidCalendarModule())
await credoapp.addModuleAsync(new AndroidSmsModule())
await credoapp.addModuleAsync(new AndroidIovationModule())
await credoapp.addModuleAsync(new AndroidApplicationModule())
await credoapp.addModuleAsync(new AndroidContactModule())
Call CredoAppService.collectAsync()
method to start the data collection process
const dataset = await service.collectAsync()
Note
Relevant for Android only
Add functionality for requesting permissions before starting the data collection process in case there are used modules that require granting dangerous permissions. The detailed info about modules can be found here.
Next Steps
After successfully integrating our SDK, it is recommended to proceed with the following steps to utilise our platform effectively:
- Setting up your Reverse Proxy
- Uploading your Dataset. Once the server is configured, you can upload your dataset using the server address.
- Collecting your Dataset Insight. With the dataset uploaded, you can now get insights.
If you have any further questions, please do not hesitate to contact us.
Updated about 1 year ago