GuidesDiscussions
Log In
Guides

Advanced Settings

Information about the feature advanced optionals

1. Sensitive Data

Add Gradle aditional dependencies :

If you want the SDK to collect sensitive data, add the following modules as needed:

ModuleSensitive DataDependency
AppServicesInstalled Apps - Running Appsimplementation 'com.digitalreef.phoenix:app-services:<version>'
PhoneServicesIMEI1 - IMEI2 - Serial Numberimplementation 'com.digitalreef.phoenix:phone-services:<version>'
TelephonyServicesPhone Number - IMSI - ICCID - Sim Data Slotimplementation 'com.digitalreef.phoenix:telephony-services:<version>'

Note: When including any of the modules, all sensitive data corresponding to that module will be captured.

implementation "com.digitalreef.phoenix:<variant>:<version>"  
implementation "com.digitalreef.phoenix:app-services:<version>"  
implementation "com.digitalreef.phoenix:phone-services:<version>"  
implementation "com.digitalreef.phoenix:telephony-services:<version>"
implementation("com.digitalreef.phoenix:<variant>:<version>")
implementation("com.digitalreef.phoenix:app-services:<version>")
implementation("com.digitalreef.phoenix:phone-services:<version>")
implementation("com.digitalreef.phoenix:telephony-services:<version>") 

Add Permissions for Sensitive Data :

The data sensible requires permissions depending on the data that is collected, please add to the manifest as appropriate:

AppServices

You can use the following code in your manifest, inside tag:

<manifest>
<!--your code -->

    <queries>
        <intent>
            <action android:name="*" />
        </intent>
    </queries>

</manifest>

PhoneServices

Your can use for Android 9 and below:

<uses-permission  android:name="android.permission.READ_PHONE_STATE" />

For Android 10+ only is captured if the app in preloaded:

<uses-permission  android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />

Note: This permission is only for preloaded variant

TelephonyServices

Your can use for Android 9 and below:

<uses-permission  android:name="android.permission.READ_PHONE_STATE" />

For Android 10+:

<uses-permission  android:name="android.permission.READ_PHONE_NUMBERS" />
<uses-permission  android:name="android.permission.READ_PHONE_STATE" />

For Preloaded App (Android 10+):

<uses-permission  android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />

Note: This permission is only for preloaded variant

Initialization of Sensitive Data Modules

The included modules must be initialized at the same time as the SDK is initialized, as follows:

public class App extends Application { 
  @Override
  public void onCreate(){
      super.onCreate();
      SiprocalSDKSettings siprocalSDKSettings = new SiprocalSDKSettings.Builder()
                  .setAppServices(new AppServices())//only if use app-services module 
                  .setTelephonyServices(new TelephonyServices())//only if use telephony-services module 
                  .setPhoneServices(new PhoneServices())// only if use phone-services module 
                  .build();
      SiprocalSDK.init(this, siprocalSDKSettings);
  }
}
class App: Application() {
  override fun onCreate() {
      super.onCreate()
      val siprocalSDKSettings = SiprocalSDKSettings.Builder()
          .setAppServices(AppServices()) //only if use app-services module 
          .setTelephonyServices(TelephonyServices())//only if use telephony-services module 
          .setPhoneServices(PhoneServices())// only if use phone-services module 
          .build()
      SiprocalSDK.init(this, siprocalSDKSettings)
  }
}

Enable/Disable capture of Sensitive Data:

Capturing sensitive data requires a prominent disclosure, and the user must consent to the app's data capture and usage. If the user consents, the app should send a boolean flag using the following method:

Keep in mind that capturing data deemed sensitive depends on the user’s acceptance of the prominent popup, which must be created and managed by the host application.

SiprocalSDK.setSensitiveData(value);
SiprocalSDK.setSensitiveData(value)

2. Custom Organization Selection

If the client wishes to have the same app available for different organizations, use the following
API from the Siprocal SDK:

SiprocalSDK.setCountryCodeSelected(context, countryCode);
SiprocalSDK.setCountryCodeSelected(context, countryCode)

Ensure that the country code mappings are created in the Siprocal servers before going live.

3. Turn ON/OFF the SDK:

If you want to handle the turning on and off of the SDK, add the method activeSDKManually() to the SiprocalSDKSettings:

public class App extends Application { 
  @Override
  public void onCreate(){
      super.onCreate();
      SiprocalSDKSettings siprocalSDKSettings = new SiprocalSDKSettings.Builder()
        .activeSDKManually()
        .build();
      SiprocalSDK.init(this, siprocalSDKSettings);
  }
}
class App: Application() {
  override fun onCreate() {
      super.onCreate()
      val siprocalSDKSettings = SiprocalSDKSettings.Builder()
          .activeSDKManually()
          .build()
      SiprocalSDK.init(this, siprocalSDKSettings)
  }
}

⚠️ The SDK by default is OFF, you need use setSDKStatus for Turn On the SDK.

That way you can then use the following method to turn it on/off:

Turn ON:

SiprocalSDK.setSDKStatus(true);
SiprocalSDK.setSDKStatus(true)

Turn OFF:

SiprocalSDK.setSDKStatus(false);
SiprocalSDK.setSDKStatus(false)

4. Passing Client Attributes to the Siprocal SDK

In some cases, the host application may need to pass attributes to the Siprocal SDK. This is
supported with the ClientAttributes class provided as part of the SDK.

To set client attributes and pass them to the Siprocal SDK, follow this code snippet:

JSONObject jsonObject = new JSONObject();
jsonObject.put("Param1", "Value1");
jsonObject.put("Param2", "Value2");
SiprocalSDK.setClientAttributes(jsonObject);
val jsonObject = JSONObject()
jsonObject.put("Param1", "Value1")
jsonObject.put("Param2", "Value2")
SiprocalSDK.setClientAttributes(jsonObject)

5. Opt-In / Opt-Out settings

The host application can provide an option to the users to Opt-In and Opt-Out of the Ads services. The same can be accomplished via the following methods to access or update the Status.

Update Opt-In status

SiprocalSDK.updateOptInStatus(applicationContext, value);
SiprocalSDK.updateOptInStatus(applicationContext, value)

Get Opt-In status

Boolean status = SiprocalSDK.getOptInStatus();
val status = SiprocalSDK.getOptInStatus()

6. Notification Channel

If you need to know information about the SDK notification channel you can use the following methods.

String channelId = SiprocalSDK.getNotificationChannelId();
String channelName = SiprocalSDK.getNotificationChannelName();
val channelId = SiprocalSDK.getNotificationChannelId()
val channelName = SiprocalSDK.getNotificationChannelName()

7. Enable logs

For debug purpose you can use the method .enableLogInfoSdk() to see the logs of SDK. In Android Studio Logcat search the word SiprocalSdk


public class MainApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        SiprocalSDKSettings siprocalSDKSettings = new SiprocalSDKSettings.Builder()
                .enableLogInfoSdk()
                .build();
        SiprocalSDK.init(this, siprocalSDKSettings);
    }
}
class MainApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        val siprocalSDKSettings: SiprocalSDKSettings = SiprocalSDKSettings.Builder()
            .enableLogInfoSdk()
            .build()
        SipocalSDK.init(this, siprocalSDKSettings)
    }
}

8. Tracking In-App Events

Siprocal SDK has potential to accept and track In-App Events from the host application, which can be used for tracking the User Journey and make many suggestive In-App message that can be configured and displayed to the user.

The SDK is preconfigured to track the following events by automatically:

  • 1st Open of the Application
  • Application coming to foreground
  • Application going to background

Sending events from Host application to SDK

Host Application can add any number of events to be tracked by the SDK.

Example for sending events :

String eventName = "EVENT_NAME";// Event name
SiprocalSDK.trackInAppEvents(context, eventName);
val eventName = "EVENT_NAME" // Event name
SiprocalSDK.trackInAppEvents(context, eventName)

9. Support to handle notification in LockScreen

If your app shows notifications on the lock screen. It is required to add the following methods so that the SDK correctly handles the behavior of the pendingIntent of the notification

public class MainApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        SiprocalSDKSettings siprocalSDKSettings = new SiprocalSDKSettings.Builder()
                .setLockScreenActivityName(LockScreenActivity.class.getSimpleName())
                .build();
        SiprocalSDK.init(this, siprocalSDKSettings);
    }
}
class MainApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        val siprocalSDKSettings: SiprocalSDKSettings = SiprocalSDKSettings.Builder()
            .setLockScreenActivityName(LockScreenActivity::class.simpleName ?: "LockScreenActivity")
            .build()
        SipocalSDK.init(this, siprocalSDKSettings)
    }
}

In the place where you invoke the pendingIntent of the notification clicked added the method clickNotificationFromLockScreen() before to invoke the pending Intent

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate() {
        super.onCreate();
        SiprocalSDK.clickNotificationFromLockScreen()

        /**
         * sample code host app LockScreen
         * pendingIntent.send();
         */

    }
}
class MainActivity : AppCompatActivity() {
    override fun onCreate() {
        super.onCreate()
        SiprocalSDK.clickNotificationFromLockScreen()

        /**
         * sample code host app LockScreen
         * pendingIntent?.send()
         */
    }
}

10. Customize Notification Sound

The SDK allow to customize the notifications sound, taking account the next recommendations:

  • Sound formats:
    • OGG (.ogg): Lightweight and plays smoothly on Android.
    • MP3 (.mp3): Wide support and widely used

  • File size: As a general recommendation, keep a weight of less than 300 KB per sound file for notifications. As they are notification sounds, they usually play quickly; Very large files can delay playback or increase the weight of the application unnecessarily.
  • Duration: 1 to 3 seconds: Because on Android, notification sounds play in a short loop or just once. A longer sound can be annoying or interrupt the user.
  • Location: SiprocalSDK will always search for files in the res/raw path of the host app.
  • Number of files: SiprocalSDK supports maximum 5 custom notification sounds.
  • File Names: File names must be without spaces or special characters; They must always respect the following standard names:
    • sip_notif_sound_1.ogg (format can be OGG or MP3)
    • sip_notif_sound_2.ogg
    • sip_notif_sound_3.ogg
    • sip_notif_sound_4.ogg
    • sip_notif_sound_5.ogg
  • 5 is the maximum number of custom sounds in addition to the device's default sound; The customer can use only the desired amount as long as it does not exceed the maximum amount.

You must define a channel name for each sound file you add, up to a maximum of 5. The name of each channel must correspond to the order in which they were added. Example:

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate() {
        super.onCreate();
        SiprocalSDKSettings siprocalSDKSettings = new SiprocalSDKSettings.Builder()
                .setNotificationChannelNames(Arrays.asList("Alerts", "Promos", "Top-ups", "Services", "TV"))
                .build();

        SiprocalSDK.init(this, siprocalSDKSettings);
    }
}
class MainActivity : AppCompatActivity() {
  override fun onCreate() {
        super.onCreate()
        val siprocalSDKSettings = SiprocalSDKSettings.Builder()
            .setNotificationChannelNames(listOf("Alerts", "Promos", "Top-ups", "Services", "TV"))
            .build()

        SiprocalSDK.init(this, siprocalSDKSettings)
    }
}

11. Pop up for sensitive data app history and data disclosure

You can now use our Sensitive Data Popup if you want us to manage it.

The SiprocalPermissionsSettings Builder was created to centrally configure the SDK’s permission dialog.
This dialog requests the user's consent to collect sensitive data, app usage history, and to opt in to the advertising service.

  • Dialog Sections
    Each section (Sensitive Data, App History, and Opt-In) must be enabled individually using the corresponding builder methods.
    For example, calling .enableSensitiveData() enables the Sensitive Data section and automatically activates the App History section due to internal validation rules.
  • Cancel Button
    Calling .isDismissible() allows the dialog to show an optional Cancel button.
    If not called, only the confirmation button will be displayed.
  • Result Callback
    When the dialog is closed, it returns a JSON object with the state of each section.
    Example:

    {
      "sensitiveData": true,
      "appHistory": true,
      "optIn": false,
      "dismiss": false
    }
    
    This allows the host app to decide the next steps based on the user’s response.
  • String and Color Resources
    Texts (e.g., siprocal_allow_sensitive_data, siprocal_ok_permission, etc.) and colors (e.g., siprocal_dialog_positive_container_button_color) are defined as Android resources.
    While the content of these resources can be customized (for localization or branding), their names must remain unchanged so the SDK can reference them properly.

Usage Example:

public class MainActivity extends AppCompatActivity {
    @Override
    public void onCreate() {
        super.onCreate();
        SiprocalPermissionsSettings siprocalPermissionsSettings = new SiprocalPermissionsSettings.Builder()
                .enableOptIn()
                .enableSensitiveData()
                .enableAppHistory()
                .isDismissible()
                .build();

        SiprocalSDK.permissionDialog(
                MainActivity.this,
                siprocalPermissionsSettings,
                jsonResult -> Log.d(TAG, "JSON RESULT: " + jsonResult)
        );
    }
}
class MainActivity : AppCompatActivity() {
    override fun onCreate() {
        super.onCreate()
        SiprocalSDK.permissionDialog(
            this@MainActivity,
            SiprocalPermissionsSettings.Builder()
                .enableOptIn()
                .enableSensitiveData()
                .enableAppHistory()
                .isDismissible()
                .build()
        ) { jsonResult: String ->
            Log.d(TAG, "JSON RESULT: $jsonResult")
        }
    }
}