Skip to main content
Version: v6

Android

Incognia SDK v6 brings a complete reorganization of classes and dependencies that best reflect the products and use cases offered by the company. A brief description of the interfaces is as follows.

ClassDescription
IncogniaContains the initialization, accountId, installationId and privacy related methods.

Replace your dependencies

Incognia SDK v6 is no longer distributed under the com.inlocomedia.android:android-sdk-engagement package. It is necessary to remove the old dependency and add the new one. You also need to update the Google Play Services dependencies in your app-level build.gradle file as shown below:

dependencies {
//REMOVE
//implementation 'com.inlocomedia.android:android-sdk-engagement:5.x.x'

//ADD THE NEW DEPENDENCY 6.6.4
implementation 'com.incognia:incognia-br:6.6.4'

//UPDATE GOOGLE PLAY SERVICES TO 17.+
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
}

Changes in public API

The functionality of the InLoco, InLocoEvents, InLocoVisits and InLocoAddressValidation classes is now grouped in the Incognia class. The following sections show equivalent method and classes in versions v5 and v6:

Changes in sdk initialization/options methods

Initialization methods now require an instance of Application instead of Context. The table below shows the equivalent method signatures in v5 and v6:

v5v6
InLoco.init(Context context)Incognia.init(Application application)
InLoco.init(Context context, InLocoOptions inLocoOptions)Incognia.init(Application application, IncogniaOptions incogniaOptions)
InLoco.disable(Context context)Incognia.disable(Context context)
InLocoVisits.setEnabled(Context context, boolean enabled)Incognia.setLocationEnabled(final boolean enabled)

For more details, please check the Initializing the SDK section.

Changes in userId methods

UserId methods were renamed and simplifed. Passing a Context instance is no longer required. The table below shows equivalent method signatures in v5 and v6:

v5v6
InLoco.setUserId(Context context, String userId)Incognia.setAccountId(String accountId)
InLoco.clearUserId(Context context)Incognia.clearAccountId()

For more details, please check the Account ID section.

Changes in address methods

This feature is also available via API, which is now the recommended way of using it. Legacy support is still available at the present moment. These methods were renamed and simplified. Passing a Context instance is no longer required. The table below shows equivalent method signatures in v5 and v6:

v5v6
InLoco.setAddress(Context context, Address address)Incognia.setAddress(Address address) - Deprecated. Prefer setting this through the Incognia API
InLoco.clearAddress(Context context)Incognia.clearAddress() - Deprecated. Prefer setting this through the Incognia API
InLocoAddressValidation.setAddress(Context context, Address address)Incognia.setAddress(Address address) - Deprecated. Prefer setting this through the Incognia API
InLocoAddressValidation.clearAddress(Context context)Incognia.clearAddress() - Deprecated. Prefer setting this through the Incognia API

Changes in events methods

Events methods were simplified and a Context instance is no longer required. CheckIn methods were removed as this feature is no longer available. The table below shows equivalent method signatures in v5 and v6:

v5v6
InLocoVisits.registerCheckIn(Context context, CheckIn checkIn)Removed. This feature is no longer supported.
InLoco.trackEvent(Context context, String eventName)Incognia.trackEvent(String eventName)
InLoco.trackEvent(Context context, String eventName, Map<String, String> properties)Incognia.trackEvent(String eventName, EventProperties properties)
InLocoVisits.trackLocalizedEvent(Context context, String eventName)Incognia.trackLocalizedEvent(String eventName)
InLocoVisits.trackLocalizedEvent(Context context, String eventName, Map<String, String> properties)Incognia.trackLocalizedEvent(String eventName, EventProperties properties)

Changes in obtaining the installation ID

The installationId can now be obtained either synchronously or asynchronously. Select the method that best suit your needs.

v5v6
InLoco.getInstallationId(Context context, IncogniaListener<String> listener)Incognia.getInstallationId()
Incognia.fetchInstallationId(IncogniaListener<String> listener)

For more details, please check the Obtaining the Installation ID section.