Basic Integration
Minimal Integration required for Siprocal SDK
Siprocal-SDK
Introduction
SIPROCAL's SDK is delivered as a Maven dependency.
⚠️ Important
SIPROCAL's SDK includes a configuration file called
siprocal-config.json
, which configures the SDK
behavior for a specific integration. This file will be provided by your SIPROCAL contact and should
be placed in the assets folder of the project.
The current version of the Siprocal SDK is 5.2.1.
Step 1: Update build.gradle
/settings.gradle.kts
for Maven repository
build.gradle
/settings.gradle.kts
for Maven repositoryUpdate the build.gradle or settings.gradle.kts file depending on the type of project you are using.
Groovy | Kotlin Script (kts) |
---|---|
1. Open the project-level build.gradle file. | 1. Open the project-level settings.gradle.kts file |
2. Go to allprojects. | 2. Go to dependencyResolutionManagement. |
3. Add the reference to JitPack and the username. | 3. Add the reference to JitPack and the username. |
allprojects {
repositories {
maven {
url "https://jitpack.io"
credentials {
username "<token provided by Siprocal>"
}
}
}
}
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://jitpack.io")
credentials {username = "<token provided by Siprocal>"}
}
}
}
Step 2: Gradle dependencies
Step 2.1: Gradle dependencies
Add the following dependencies to the app module's build.gradle:
implementation 'com.github.Digita1Reef.phoenix:<variant>:<version>' //for Groovy
implementation("com.github.Digita1Reef.phoenix:<variant>:<version>") //for Kotlin KTS
⚠️ About the variant:
Note: The variant used will be provided by Siprocal, if the variant name has not yet been provided, contact us
Step 2.2: Add ProGuard exception rules
Note: If you have minifyEnabled true, make sure to add the following ProGuard rules to ensure all SDK services work correctly.
Add the following lines to your proguard-rules.pro file:
-dontwarn org.slf4j.impl.StaticLoggerBinder
# Keep all classes that are marked as @Serializable
-keep @kotlinx.serialization.Serializable class * { *; }
# Keep all generated serializer companions
-keepclassmembers class * {
kotlinx.serialization.KSerializer serializer(...);
}
You need add the following rules only If you are using the variants: helios or hestia
-dontwarn java.lang.management.ManagementFactory
-dontwarn java.lang.management.RuntimeMXBean
-dontwarn java.lang.reflect.AnnotatedType
-dontwarn org.slf4j.impl.StaticMDCBinder
-dontwarn org.slf4j.impl.StaticMarkerBinder
Step 3: Add Notification Permission for the Host App (Android 13+)
To allow the app to receive push it is necessary to add the permission:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
Note: This permission must be requested from the user by the Host App at execution time.
Step 4: Permissions Required for capture Advertising ID
To capture the AdvertisingId it is necesary to add the permision:
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
Step 5: Permissions Required for capture Location
Note: Use this permission if it's required for you App.
To be able to collect the location the Siprocal SDK requires the following permissions:
Note: This permission must be requested from the user by the Host App at execution time.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
From Android 10 or higher, in order to be able to collect the location in background the following permission is required:
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
Step 6: SDK Initialization from the Application Class
The SDK should be initialized from the onCreate() method of the Application class in your app.
Note: If you don't have the Application Class, you can get more info about this in the following link: Android Reference
public class App extends Application {
@Override
public void onCreate(){
super.onCreate();
SiprocalSDK.init(this);
}
}
class App: Application() {
override fun onCreate() {
super.onCreate()
SiprocalSDK.init(this)
}
}
Parameters of init() method:
Application : Reference to the application class (this).
Step 7: Validate if your app use Splash Screen
⚠️ If you are using Splash Screen:
If you app use a Splash Screen you need add the Splash Support, for that please check the Splash Support documentation: Splash Support Documentation
Step 8: Validate if you already use FCM in your project
⚠️ If you are using FCM:
Note: If you app use FCM you need add support for FCM Siprocal, for that please check the Firebase Integration section:
Step 9: Configure Siprocal Server for the Host App
Minimal configuration needs to be done on the Siprocal Server to connect to the host app via FCM. Provide the package name of the host app to SDK provider.
Updated 7 days ago