Android SDK 7.0.1 and iOS SDK 6.0.2

The Leanplum Android SDK 7.0.1 and iOS SDK 6.0.2 wrap the CleverTap Android/iOS SDKs to enable the migration to CleverTap. For questions, migration requirements, and possibilities, reach out to your point of contact at Leanplum.

Contents

Android

If you are upgrading from version 5.x.x or older, please make sure to check 6.0.0 upgrade guide first.
Version 7.0.1 includes CleverTap Android SDK 4.6.6 as a dependency to allow seamless client migration.

📘

The Leanplum SDK sets the keys and initialized CleverTap.

You should not include the CleverTap account and token. You should not integrate the CleverTap SDK.

Deprecations

  • Leanplum.forceNewDeviceId(...) is deprecated. When migration of data to CleverTap is turned on calling this method with a different device ID would not work anymore.
  • Leanplum MiPush module (com.leanplum:leanplum-mipush) is deprecated in favor of CleverTap Xiaomi Push SDK. Check Optional configuration below.

Updates

  • Minimum supported Android SDK version is increased to API level 16.
  • Requirement on target SDK version to API level 31, which is enforced by Google Play requirements starting from November 2022.
  • Minimum Firebase Cloud Messaging SDK supported version is increased to 20.3.0.
  • New Leanplum.addCleverTapInstanceCallback(...) and Leanplum.removeCleverTapInstanceCallback(...) methods. It sets a callback object to be notified once CleverTapAPI instance is created.

HMS module updates

  • Minimum supported Android SDK version is increased to API level 18 (enforced by agconnect plugin).
  • SDK dependencies:
com.huawei.hms:push:6.5.0.300
com.huawei.agconnect:agconnect-core:1.6.5.300
  • Gradle plugin:
com.huawei.agconnect:agcp:1.6.5.300

MiPush module updates

  • MiPush SDK Client is updated to 4.8.6

Optional configuration

You need to add a dependency to CleverTap Android SDK in your build.gradle file to use CleverTap methods:

implementation 'com.clevertap.android:clevertap-android-sdk:4.6.6'

New Leanplum callback method

Use the method to set a callback object to be invoked when CleverTapAPI instance is created. Use this callback to initialise any CleverTap state.

// Add callback
Leanplum.addCleverTapInstanceCallback(callback);
// Remove callback
Leanplum.removeCleverTapInstanceCallback(callback);

CleverTap push notifications

// Add Gradle dependency in your project:
implementation 'com.clevertap.android:push-templates:1.0.3'

// Add before SDK initialisation
CleverTapAPI.setNotificationHandler(new PushTemplateNotificationHandler());
  • Registration of notification channels
    CleverTap SDK does not register Android notification channels automatically so make sure each one used in your CleverTap campaigns is registered. Here is example of a single channel registration:
// Register notification channels
Leanplum.onCleverTapInstanceInitialized(cleverTapInstance -> {
    CleverTapAPI.createNotificationChannel(
        RondoApplication.this,
        "YourChannelId",
        "Your Channel Name",
        "Your Channel Description",
        importance, // same as importance levels defined in NotificationManager
        true); // boolean used for setShowBadge(...)
});
  • CleverTap Xiaomi Push SDK
    In order to use Xiaomi pushes follow CleverTap documentation, where dependency versions tested with Leanplum Android SDK are:
implementation "com.clevertap.android:clevertap-xiaomi-sdk:1.5.1"
implementation files("libs/MiPush_SDK_Client_5_0_6-G_3rd.aar") // downloaded from CleverTap docs

It is mandatory to use Xiaomi pushes with MIUI devices only. Call this method before SDK initialisation:

CleverTapAPI.enableXiaomiPushOn(PushConstants.XIAOMI_MIUI_DEVICES);

iOS

If you are upgrading from version 4.x.x or older, please make sure to check 5.0.0 upgrade guide first.
Version 6.0.2 includes CleverTap iOS SDK 4.1.5 as a dependency to allow seamless client migration.

📘

The Leanplum SDK sets the keys and initialized CleverTap.

You should not include the CleverTap account and token. You should not integrate the CleverTap SDK. You should not call autoIntegrate.

Installation

  • CocoaPods - no changes, CleverTap SDK and its dependencies will be included automatically.
  • SPM - it now uses a target wrapper to automatically load the CleverTap SDK as a package dependency. Leanplum SDK uses the static xcframework binary.
  • Manual:
    • dynamic xcframework - the xcframework does not contain the CleverTap SDK and its dependencies. It cannot be used standalone. You need to add CleverTap SDK and SDWebImage as dependencies. You must use dynamic linking to avoid duplicate symbols. You can find the frameworks inside the Leanplum.zip. See the manual integration steps for CleverTap for more details here.
    • static xcframework - the static xcframework only links the CleverTap SDK and its dependencies. It cannot be used standalone. In this case, you need to statically link CleverTap SDK and its dependencies. See the manual integration steps for CleverTap here. Leanplum SDK does not embed the CleverTap SDK in this case, since if your application is already using CleverTap SDK or any of its dependencies, duplicate symbols will be generated.

Deprecations

  • Changing Device Id by calling Leanplum.setDeviceId(...) mid-session or after the first install is not allowed. When the migration of data to CleverTap is turned on calling this method with a different device ID would not work anymore. The method can still be called before Leanplum.start to set a custom device ID, but this Device ID can no longer be changed after this.

Updates

  • New Leanplum.addCleverTapInstanceCallback(...) method. It sets a callback to be notified once the CleverTap instance is created.

CleverTap

If you want to do any CleverTap configurations, use the instance provided by the Leanplum.addCleverTapInstanceCallback callback.

The CleverTap Developer documentation is available here.

Note that if you are integrating manually on iOS, you need to add the CleverTap SDK to access its methods, check the documentation above.

FAQ

Q: Can I continue to use all Leanplum features with the latest SDK versions?
A: Yes, all features remain intact, you can continue to use the SDK as before.

Q: Are there any calls made to CleverTap with this version?
A: No, there are no additional calls to CleverTap, unless you start the migration process. This is a manual process driven by the Customer Success team along with the customer.

Q: Should I upgrade to the latest versions if I'm not ready to migrate to CleverTap?
A: You can upgrade to the latest versions if you need any of the fixes and new features provided. You can stick to the previous version If you don't need any of these. The new versions add ~800KB to the Android SDK and ~700KB to the iOS SDK due to the added dependency to the respective CleverTap SDKs.

Q: Do I start the migration to CleverTap automatically if I upgrade to the latest SDK version?
A: No, the migration to CleverTap is a manual process driven by the Customer Success team along with the customer.