MoEngage will support at minimum API level 23 for Android and iOS 13 for iOS starting March 1, 2025. Currently, the MoEngage SDK supports Android API level 21 and 22 (Android 5, Lollipop) for Android and iOS 12 for iOS devices. Releases after Match 1, 2025, will increase the minimum supported:
- API level from 21 to 23 (Android 6, Marshmallow) for Android
- iOS 12 to iOS 13 for iOS
Why Are We Discontinuing Support for API Level 21 and 22 and iOS 12 in MoEngage SDK?
For Android
The Lollipop platform and iOS 12 are almost 8 and 6 years old respectively. A very small percentage of all Android devices are using these or lesser versions. You can read more about the current distribution of Android devices. We believe that many of these old devices are not actively being used.
Many developers have already discontinued support for these versions in their apps. This helps them build better apps that make use of the newer capabilities of the platforms. For MoEngage, the situation is the same. By making this change, MoEngage can provide a more robust collection of tools for developers with greater speed.
What Does This Mean for Your App That Uses MoEngage SDK?
You may use versions of MoEngage SDK released before Match 1, 2025 as you are currently using. These versions will continue to work with Lollipop and iOS 12 devices even after March 1, 2025 as they have worked in the past
When you choose to upgrade to the future versions released after March 1, 2025, you will not encounter any versioning problems if your app supports:
- Android API level 23 or greater (typically specified as “minSdkVersion” in your build.gradle)
- iOS 13
However, if your app supports lower than API level 21 or 22 or iOS 12, you will encounter a problem at build time with an error. This means, you will not be able to successfully run your app on older devices. To use MoEngage SDK versions released after March 1, 2025, you can choose one of the following options:
For iOS
To discontinue support for iOS 12, perform the following changes in the General tab of your target XCode project:
- Select the minimum iOS version you want to support in the Deployment Target drop-down list.
- If your app is compatible with multiple devices, make sure to set the minimum iOS version for each device type (iPhone, iPad, and so on) in the same Deployment Info section.
For Android
- Target API level 23 as the minimum supported API level (recommended)
To discontinue support for API levels that are no longer supported by the MoEngage SDK, increase the minSdkVersion value in your app’s build.gradle to at least 23. If you update your app in this way and publish it to the Play Store, users of devices with less than that level of support cannot see or download the update. However, they can still download and use the most recently published version of the app that does target their device.
For Android devices, if your app still has a significant number of users on older devices, you can use multiple APK support in Google Play to deliver an APK that uses lower versions of the MoEngage SDK. This is described below. - Build multiple APKs to support devices with an API level less than 23 (not recommended).
With some configuration and code management, you can build multiple APKs that support different minimum API levels, with different versions of the MoEngage SDK. You can accomplish this with build variants in Gradle. First, define build flavors for legacy and newer versions of your app. For example, in your build.gradle, define two different product flavors, with two different compile dependencies for the components of Play Services you are using:productFlavors {
legacy {
minSdkVersion 9??
versionCode 901 // Min API level 9, v01??
} current {
minSdkVersion 14??
versionCode 1401 // Min API level 14, v01??
} }
dependencies {
legacyCompile 'com.google.android.gms:play-services:10.0.0'??
currentCompile 'com.google.android.gms:play-services:10.2.0'??
}
In the situation above, there are two product flavors being built for two different versions of the Google Play services client libraries. This will work fine if only APIs available in lower MoEngage SDK versions are called. If you need to call newer APIs made available with versions released after March 1, 2025, you must create a compatibility library for the newer API calls so that they are only built into the version of the application that can use them:
- Declare a Java interface that exposes the higher-level functionality you want to perform that is only available in the current versions of Play services.
- Build two Android libraries that implement that interface. The current implementation must call the newer APIs as desired. The legacy implementation must no-op or otherwise act as desired with older versions of the MoEngage SDK. You must add the interface to both libraries.
- Conditionally compile each library into the app using legacyCompile and currentCompile dependencies.
- In the app’s code, call through to the compatibility library whenever newer MoEngage SDK APIs are required.
After building a release APK for each flavour, publish them both to the Play Store, and the device will update with the most appropriate version for that device. Read more about multiple APK support in the Play Store.
info |
Note For any queries, you can reach out to your CSM or raise a support ticket. |