Initializing the SDK
Step 4: Invoke SDK from the App
4.1 Create Application Class (if not available)
If the application class is not created, please create a class by extending from android.app.Application
. Add the above lines of code into onCreate```` method of the application class. Also, add the Application class name inside
tag in
AndroidManfest.xml``` file.
public class MyApp extends Application {
@Override
public void onCreate() {
super.onCreate();
...
IUApp.init(this, HostComplianceActivity.class);
//or
IUApp.init(this, null);
}
}
add the Application Class reference to AndroidManifest.xml file
<application
android:name=".MyApp"
...
...>
...
...
</application
>
4.2 Invoke SDK
DR SDK needs to be initialised from the Android Application class. Please add the following lines of code to the Application class.
IUApp.init(this, HostComplianceActivity.class);
// or
IUApp.init(this, null);
Invoke SDK from the App
APP should invoke the SDK using the following code. It is important to include this in a point where the user always interacts like the launch of the host application.
cordova.plugins.amlibrary.launch("launch", success, failure);
This takes 3 parameters
- 'launch' - Command to be invoked
- success - fucntion reference where the successful call back can be triggered.
- failure - function reference where the failed call back can be triggered.
Updated over 2 years ago