Add the following to the root gradle file.
allprojects {
repositories {
...
maven { url "https://repos.appsfly.io/artifactory/libs-release-local" }
}
}
implementation ('io.appsfly.android.utils:core:1.2.22'){
transitive = true
}
Note: If you are using a lower version of Android Studio, use 'compile' instead of 'implementation'
Obtain a unique secret key from Appsfly.io (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). To keep the secret key secure, it is recommended to follow the below steps.
-
Place this key in the gradle.properties file of the Android Project.
appsfly_app_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-
Add the following config to the manifest placeholders.
defaultConfig {
...
manifestPlaceholders.appsfly_app_key = "${appsfly_app_key}"
}
- Add the following to the application module Manifest file.
<application
android:name=".MyApplication"
...
android:label="My Application">
<meta-data
android:name="appsfly_app_key"
android:value="${appsfly_app_key}" />
...
/>
Override your Application/Activity Instance onCreate() method
@Override
public void onCreate() {
super.onCreate();
AppsFlyClientConfig appsFlyClientConfig = new AppsFlyClientConfig(this, "MICRO_HANDLE", getString(R.string.repo_url));
}
This will start the process of syncing Metadata required to run MicroApp in your application.
To get the Data, run the following snippet.
afMicroService = new AFMicroService(appsFlyClientConfig, this);
afMicroService.execIntent("*INTENT_NAME*", *new JSONObject()[INTENT_DATA]*, new Callback<JSONObject>() {
@Override
public void send(JSONObject finalClient) {
-----
}
});
//Replace INTENT_NAME,INTENT_DATA
Note: Contact the [email protected] for any issues with integration.