Skip to content
szabist edited this page Sep 3, 2021 · 55 revisions

Contents

When do we increase the minimum Android version required for the SDK?

Trying to support reaching a large portion of the Android device base while also increasing the quality and efficiency of the SDK by incorporating newer and newer platform features is a delicate balancing act. We track our own SDK user base and if the share of a given API level falls below 3%, we may increase the minimum API level and cease supporting devices running an API level having less than 3% share. When this happens we issue a notice at least 3 months in advance about the planned change in platform support. To be transparent, we publish updates of the device level statistics from our user base here.

Android version distribution:

Version 2021.03 2020.12 2020.05 2019.08
11.0.0 14.18% 2.73% - -
10.0.0 55.57% 57.13% 23.01% -
9.0.0 16.42% 19.90% 36.82% 40.64%
8.1.0 2.85% 3.85% 7.52% 14.29%
8.0.0 6.05% 7.34% 10.77% 11.63%
7.1.2 0.43% 0.49% 0.82% 2.56%
7.1.1 0.62% 1.04% 2.24% 4.99%
7.0.0 2.51% 3.71% 6.67% 9.45%
6.0.1 0.48% 1.39% 3.52% 6.38%
6.0.0 0.31% 0.81% 5.81% 3.39%
5.1.1 0.39% 1.04% 1.40% 3.00%
5.1.0 0.05% 0.15% 0.59% 1.41%
5.0.2 0.09% 0.23% 0.31% 0.71%
5.0.1 0.02% 0.06% 0.11% 0.16%
5.0.0 0.02% 0.05% 0.12% 0.29%
4.4.4 - - - 0.34%
4.4.2 - - 0.10% 0.48%

Which version of the SDK do we support?

We only offer support for the latest version of the SDK. If you run an earlier version of the SDK and report a bug, we will fix the bug only if it is still reproducible with the latest SDK version and ask you to upgrade to the newest version when released with the bug fix. In order to minimise disturbance when upgrading to a new version, we have a comprehensive regression test suite and we do our utmost best to maintain backward compatibility. In the rare case when maintaining backward compatibility is not possible, we will provide clear indication of the functionality impacted and suggestions to mitigate the problem.

Can the Emarsys SDK be integrated with React Native apps?

As React Native gives good support for building wrappers around platform native SDKs, using our Emarsys Mobile SDK in this way is doable, and we have an example repository here but we can not currently offer help to debug problems specific to using the Emarsys Mobile SDK in React Native applications.

Can the Emarsys SDK be integrated with Flutter apps?

We offer a plug-in to use the Emarsys SDK from a Flutter application.

The Firebase dependencies are outdated in the Emarsys SDK. When will you release a new version with up-to-date dependencies?

We are trying our best to keep our dependencies up-to-date by periodically releasing new SDK versions with updated dependency versions.

If it is urgent and you cannot wait till the new release, you can manually exclude the transitive dependencies in your module-level gradle file and add the Firebase dependencies manually.

You should replace the + signs with the most recent concrete versions.

dependencies {
    implementation('com.emarsys:emarsys-sdk:+', {
        exclude group: 'com.google.firebase', module: 'firebase-core'
        exclude group: 'com.google.firebase', module: 'firebase-messaging'
    })
 
    implementation 'com.google.firebase:firebase-core:+'
    implementation 'com.google.firebase:firebase-messaging:+'
 }

The default EmarsysFirebaseMessagingService or EmarsysHuaweiMessagingService that ships with the Emarsys SDK does not suit our requirements, we need extra features. How can these features be included in the service?

The main purpose of the default FCM and HMS services in the SDK are to provide an implementation that works for you out of the box when integrating the SDK. We try to keep the services generic so that they suit the default use cases of our customers. If you have special requirements, we suggest implementing your own messaging service based on our default implementation. When implementing your own messaging service, make sure to handle messageOpens correctly.

Here is a detailed example of how your implementation should look like:

public class CustomMessagingService extends FirebaseMessagingService {

    @Override
    public void onNewToken(String token) {
        super.onNewToken(token);

        Emarsys.Push.setPushToken(token);
    }

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);

        boolean handledByEmarsysSDK = EmarsysMessagingServiceUtils.handleMessage(
                this,
                remoteMessage);

        if (!handledByEmarsysSDK) {
            //handle your custom push message here
        }
    }
}

Emarsys SDK handles push messages received from Emarsys by default, if you have the same implementation as in the above example, otherwise, you have to track message opens by calling trackMessageOpen method and also make sure of displaying the push.

In addition, make sure that in AndroidManifest.xml you register your own custom messaging service instead of the Emarsys one, see the example here.

I get a 'Could not find firebase-core' error in gradle when trying to integrate the SDK

This is not an Emarsys, but a Firebase issue, consult the Firebase documentation to solve the problem.

Push messages don't arrive to the device

Did you download google-services.json/agconnect-services.json? If not please follow the corresponding Firebase documentation or Huawei Push Kit documentation to setup your app with a messaging service first. Make sure the connection to Firebase / HMS is not limited by company firewall rules. Make sure you see push tokens in your SDK Logs inside Mobile Engage UI.

Missing Push tokens

Make sure you registered our EmarsysFirebaseMessagingService or EmarsysHuaweiMessagingService in your AndroidManifest.xml.

Missing messageOpen events

Make sure you registered our EmarsysFirebaseMessagingService or EmarsysHuaweiMessagingService in your AndroidManifest.xml.

What happens with the SDK events when the device is offline?

Emarsys SDK features an offline queue. All SDK events including e.g. logins, logouts, custom events, Predict related view and click events and requests enter this queue first. As long as the device is online, this queue is processed and events get sent to the backend continuously. While the device is offline, the queue stores the SDK events temporarily and when the SDK detects that network connectivity is back, it restarts the event sending. The events stay in the queue until a response from the server is received, so the SDK can resend events in case a network error or a timeout occurs during sending or the server responds with a recoverable error code. If the server responds with a non-recoverable error code, e.g. authentication failure, the event is discarded.

What data is collected automatically by the Emarsys SDK?

Please find it here

Emarsys SDK uses another version of Kotlin than my application, should I be concerned?

In case your application uses an older Kotlin, while Emarsys SDK uses a newer one once your application is built your binary will contain both versions of Kotlin. In this case, the Emarsys SDK is using the newer, while your own application is using Kotlin the older.

The same rule applies to patch version differences on any other dependencies as well.

We generally update all the SDK dependencies to the latest available backward compatible version at the time of every new SDK release. This is to ensure that the Emarsys SDK always uses the latest, most stable, most up-to-date version available of all its dependencies.

Emarsys SDK forces my app to use Java 1.8, isn't this a problem?

From Kotlin 1.5.x, it forces the app to use java 1.8 sourceCompatibility. If you still don't use this Kotlin version or using Java ≤ 1.8, add this snippet to yout build.gradle:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8
}

What data is stored on the device by the Emarsys SDK?

URLSs of the Emarsys Mobile Engage back-end services:

  • EVENT_SERVICE_URL
  • CLIENT_SERVICE_URL
  • MESSAGE_INBOX_SERVICE_URL
  • DEEPLINK_SERVICE_URL
  • PREDICT_SERVICE_URL

The required tokens for the communication with the Emarsys Mobile Engage back-end services:

  • CONTACT_TOKEN
  • CLIENT_STATE
  • REFRESH_TOKEN

For the custom event tracking:

  • DEVICE_EVENT_STATE

Geofence information:

  • GEOFENCE_ENABLED
  • GEOFENCE_INITIAL_ENTER_TRIGGER

Push token:

  • PUSH_TOKEN

Hardware details:

*DEVICE_INFO

If verboseConsoleLogging is enabled then all this information is printed out to the console after the setup of the Emarsys SDK.

Clone this wiki locally