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 Lock screen

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()
         */
    }
}