NAV Navbar
  • Introduction
  • Getting started
  • Installation
  • Initialization
  • User data recording
  • Push notifications
  • Conversion data
  • Introduction

    Welcome on the Omnisense Android SDK Documentation. You can use these to retrieve and add informations on your Omnisense instance.

    Current SDK Version : 1.2.0

    Omnisense is an omnicanal CRM.

    With Omnisense, you can manage the entire lifecycle of your users : Acquisition, Segmentation, Reengagement.

    Acquisition : Omnisense is connected to the main advertising companies of the market and will allow you to manage your acquisition easily.

    Segmentation : Retrieve all your user data within a clear and intuitive interface and segment them in a few clicks.

    Reengagement : Push, mails, sms ... You can reengage your users with all possible and unimaginable means...

    Getting started

    Before installing Omnisense, you should follow one of these links which explain how to integrate FCM or GCM inside your app : Firebase Cloud Messaging or Google Cloud Messaging

    Adding Omnisense to your project



      // settings.gradle
      include ':app', ':omnisense' //Append :omnisense to the list of included modules

    Project level build.gradle

      // (top-level) build.gradle
      dependencies {
        classpath ''
        classpath ''

    App level build.gradle

      // (app-level) build.gradle
      dependencies {
        compile project(':omnisense')
      // Add at the bottom of the file
      apply plugin: ''

    In AndroidManifest.xml (Replace "yourpackage" by your app's package) Replace omnisense_api_key and omnisense_instance values according to your credentials.

    The omnisense_instance is the beginning of your Omnisense instance URL. Example: If instance's URL is "" then omnisense_instance = myinstance.

            android:protectionLevel="signature" />
      <uses-permission android:name="yourpackage.permission.C2D_MESSAGE" />
      <application ...>
         <meta-data android:name="omnisense_api_key" android:value="your_api_key" />
         <meta-data android:name="omnisense_instance" android:value="YOUR_INSTANCE" />
         <meta-data android:name="gcm_sender_id" android:value="@string/gcm_defaultSenderId" />
              <action android:name="" />
              <category android:name="yourpackage" />
              <action android:name="" />

    Updating your project to include Omnisense is easy but requires you to put some modifications in your settings.gradle, build.gradle at the project level and your build gradle at the app level. You'll find more informations to follow in the right part of your screen.



    Minimal initialization

    public class App extends Application {
      public void onCreate() {
        //Must be called before anything else

    The Omnisense SDK is now successfully included in your project.

    Now you must create an App class extending Application at the root of your app.



    public class BaseActivity extends AppCompatActivity {
      public void onStart()
      public void onStop()

    Then in every Activities you just need to extends BaseActivity and everything will be set using the hierarchy

    public class AnyActivity extends BaseActivity {

    The next point is to add the Omnisense SDK in every activities you need or want. This part is very easy and requires a bit of code.

    We recommand you to create a BaseActivity class extending AppCompatActivity. That will make you win a lot of time with a very little amount of code.

    User data recording

    User profile management

      OmnisenseUser user = Omnisense.getInstance().getCurrentUser(); = "";
      user.fb_id = "12143534535646";
      user.firstName = "John";
      user.lastName = "Doe";

    To identify the user on Omnisense (after login or sign up), simply update the fields on the OmnisenseUser provided by the instance.

    If you want to add or update some of the user attributes, you can get the current user with the method getCurrentUser and change the values. You will have to call the saveUser after settings the values in order to save them to Omnisense.

    After a log out, simply call the resetCurrentUser to remove the current user.

    Available fields

    Field Value Description
    email String
    fb_id String
    firstName String
    lastName String
    birthday Date
    phone String
    address String
    city String
    postal_code String
    country String must be the iso code for country (ISO 3166)
    lang String must be the iso code for lang (ISO 639)
    sex String One of "male", "female"
    optin Boolean Set to true if the user is optin to receive email

    You can add custom fields with the setMetadata method, if needed.

    Event recording

    Segment segment = new Segment();
    segment.put("id", "1234");
    segment.put("product_name", "The best product ever");
    segment.put("category", "New stuff");
    Omnisense.getInstance().recordEvent("product.view", segment);

    To record an event made by the user in the app, call the record event method with segmentation.

    Method Informations

    Function name: recordEvent(identifier: String, segments: Hash)

    Method Parameters

    Parameter Value Description
    identifier String The action name
    segments Hash Set of key/values describing the event ()

    Push notifications

    public class App extends Application {
      public void onCreate() {
        Omnisense.getInstance().getNotificationConfig().setPushListener(new PushReceptionListener() {
          public void onPushReceived(JSONObject extras) {
            This is a basic config. The extras object contains the params sent by Omnisense.
            If the extras already contains "u" param, then a deep linking is already present in the extras. Otherwise, you can create your own deep linking according to the provided param then add it to the "u" param. */
            String url =  extras.getString("u"); //or extras.getString("open_url") or whatever param sent with an url
              NB : If the param containing the URL scheme is not "u", you must add it, otherwise it won't work.
            extras.put("u", url);
            You can also download a picture to display inside the notification.
            To do so, you have to provide a key called "i" and set the URL of the picture.
            String image = "";
            extras.put("i", image);
            You can also display actions.
            Actions must be added on the "extras" json with "a1" and "a2" keys,
            each containing "l" and "u" param.
            l = Label of the button
            u = URL which will be passed to the intent
            JSONObject action1 = new JSONObject();
            JSONObject action2 = new JSONObject();
            action1.put("l", getResources().getString(R.string.notification_action_1_label));
            action1.put("u", url+"&action=do_something");
            action2.put("l", getResources().getString(R.string.notification_action_2_label));
            action2.put("u", url+"&action=do_something_different");
            extras.put("a1", action1);
            extras.put("a2", action2);
            //Set the action icons
          public void onNotificationDisplayed() {
        Omnisense.getInstance().initialize(); //Must be called before anything else

    You can customize received push notifications by setting an icon or the activity which should be opened on click.

    The customization has to be done when receiving the push.

    You can add a picture, change icon, or add action(s) to your notification.

    The implementation of your URL scheme is up to you. You have to handle it on the receiving activity (set with setClickActivityClass).

    You can refer on the right part to a

    Conversion data

    public class App extends Application {
      public void onCreate() {
        Omnisense.getInstance().setTrackingListener(new OnOmnisenseFingerprintListener() {
          public void onOmnisenseFingerprintCompleted(Map<String, String> map) {
            // do whatever you want with the returned info

    In case you want to use Omnisense conversion data at first launch in your app, you can use the following method before initialize() method in your file.