Integrating the DT Ignite Services (DTIS) SDK with your Host App allows you to connect to and interact with the Ignite client that is present on a device. The connection allows you to check for apps on the device, retrieve app metadata, install apps from the Ignite ecosystem, and launch apps after installation.
The following diagram provides an overview of how your Host App uses the DTIS SDK to communicate with Ignite on the device.
To integrate the DT Ignite Services (DTIS) SDK into your Host App:
Obtain a clientID from DT.
The clientID identifies your Host App in the DT environment.
Provide the clientID in the meta-data tag of the AndroidManifest.xml file for your Host app.
XML
<manifestxmlns:android="http://schemas.android.com/apk/res/android"package="com.mycompany.myapp"><application ... > ...<!-- Example Client ID --><meta-dataandroid:name="com.digitalturbine.ignite.aidl.CLIENT_ID"android:value="52093f98-63a7-45b4-b9fb-191c685d6a40"/></application></manifest>
Add ignite-service-aidl-sdk.aar to your libs/ folder in your project, or, if you use shared sources, import it as as a module.
Step 2: Call SDK Methods
The DTIS SDK offers methods that allow you to interact with Ignite on a device. For a complete list of use cases and the appropriate methods to call, see Use Cases.
To call DTIS SDK methods in your Host App:
Declare and connect an instance of IIgniteService.kt. Once connected, the DTIS SDK automatically authenticates the Host App using the credentials stored in AndroidManifest.xml. The DTIS SDK also manages the session and any subsequent token refreshes. For more information, see Connect to Ignite.
Call DTIS SDK methods according to the SDK Reference.
To test your DTIS integration, ensure that your test environment meets the following requirements:
Ignite is installed on the test device. For more information about installing Ignite on a device, contact your DT Representative.
Host App is integrated with DTIS and installed on the test device.
Host App fingerprint and signing certificate are unique to Testing environment.
Step 4: Prepare Host App for Production
Once you have completed testing your Host App, create a Production version of your Host App that uses a unique fingerprint and signing certificate that are different from the from those used in the testing environment.
Example: Full Integration
The following example code shows a full integration using the DTIS SDK.
A fully integrated demo application is available on request for existing customers. For access to the demo application, contact your DT Representative.
lateinit var igniteService: IIgniteService
// ...
// After SDK is initialized, the IgniteService instance is returned.
// It can also be retrieved later using IgniteServiceSdk.instance()
// NOTE: `clientSecret` can be empty for initial integration
igniteService = IgniteServiceSdk.init(context, clientSecret)
// ...
IgniteServiceSdk.instance().connect(object: IConnectionCallback {
override fun onConnected() {
// Connection with Ignite is established
Toast.makeText(applicationContext, "Connected.", Toast.LENGTH_SHORT).show()
}
override fun onAuthenticated() {
// Client is now able to call API methods
Toast.makeText(applicationContext, "Authenticated.", Toast.LENGTH_SHORT).show()
}
override fun onDisconnected(message: String?) {
Toast.makeText(applicationContext, "Disconnected from Ignite Service: $message", Toast.LENGTH_SHORT).show()
}
})
// or
igniteService.connect(this)
Kotlin
findViewById<Button>(R.id.version).setOnClickListener {
val result = IgniteServiceSdk.instance().version()
Toast.makeText(applicationContext, "SDK version: ${result?.sdkVersion}, Ignite version: ${result?.igniteVersion}", Toast.LENGTH_SHORT).show()
}