Advanced features

Set the default Activity

The Activity by default is the initial screen of your app that is launched when a user clicks on a notification that does not have a deeplink. It is also the point where you should initialize the SDK. It is set by the DefaultActivity parameter:

//When you want to start indigitall
Configuration config = new Configuration
    .Builder("<YOUR-APP-KEY>", "<YOUR-SENDER-ID>")
    .setDefaultActivity("YOUR_ACTIVITY")
    .build();
Indigitall.init(context, config);

Associate the device with a user

You can associate your own ID to each device. In this way it will be easier and more intuitive for you to work with our tool. For example:

  • If your users have been identified, you could use your user ID, or email, or any other data that you are used to working with.
  • If your users are anonymous because they have not logged into the app, you may have a Google Analytics or Commscore metric system. You could use the ID provided by these tools.

To make this association between your custom ID (externalId), and the identifier handled by indigitall (deviceId), you have to invoke the setExternalCode method:

Indigitall.setExternalCode(this, "YOUR_EXTERNAL_ID", new DeviceCallback(context) {
    @Override
    public void onSuccess(Device device) {
        //DO SOMETHING
    }
    @Override
    public void onFail() {
        //LOG ERROR
    }
});

Do not worry about anything. Your IDs are irreversibly encrypted on the phone itself and sent securely to our servers. Not even the indigitall team can know this information.

WiFi filter

If it is required to collect the user's WiFi information, in addition to the configuration of the Indigitall panel, you must add in the manifest the permissions that are exposed below, the service corresponding to the filter and add the parameter wifiFilterEnabled when it is initialize the SDK.

Add the following on the manifest:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>

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

  // ANDROID 12 WIFI
  <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

//WiFi service
<service
    android:name="com.indigitall.android.services.WifiStatusService"
    android:permission="android.permission.BIND_JOB_SERVICE" >
</service>

<receiver android:name="com.indigitall.android.receivers.WifiWakeLockReceiver">
    <intent-filter>
        <action android:name="AlarmReceiver.Action.NETWORK_ALARM" />
    </intent-filter>
</receiver>

And on init:

Configuration config = new Configuration
    .Builder("<YOUR-APP-KEY>", "<YOUR-SENDER-ID>")
    .wifiFilterEnabled(true)
    .build();
Indigitall.init(context, config);
  • From android 8.0 to obtain the WiFi data, which are added to the manifest the location permissions. More information here: Android Developers

  • Please note that the WiFi scan time when the app is in the background or closed may be inaccurate.

Custom domain

if you are ENTERPRISE CUSTOMER you have to add this parameter in the configuration so that the SDK points to the correct environment:

Configuration config = new Configuration
    .Builder("<YOUR-APP-KEY>", "<YOUR-SENDER-ID>")
    .setUrlDeviceApi(YOUR_DEVICE_API_DOMAIN)
    .setUrlInAppApi(YOUR_INAPP_API_DOMAIN)
    .setUrlInboxApi(YOUR_INBOX_API_DOMAIN)
    .build();
Indigitall.init(context, config);