Skip to content

Migration guide

Ivan Krešić edited this page Oct 10, 2024 · 19 revisions

Migration from '12.x.x' to '13.x.x'

Introduction of Android 15

Since this version, we provide support for Android 15:

  • compileSdkVersion was changed from 34 to 35
  • targetSdkVersion was changed from 34 to 35

Deprecated Geofencing feature

Notice!

Geofencing feature is DEPRECATED and not supported from SDK version 13.0.0 onwards.

Since Geofencing feature is deprecated, you might have geo messages table remain on devices database (if you used this feature). To remove the table, you can implement the following code:

    SQLiteDatabase db = this.getWritableDatabase();
    db.execSQL("DROP TABLE IF EXISTS geo_messages");

Scheduled jobs for Geofencing are removed from the system and no longer supported:

  • GEO_TRANSITION_JOB_ID
  • GEO_CONSISTENCY_JOB_ID

Migration from '12.3.x' to '12.4.x'

Changes for the in-app chat

Version 12.4.0 onwards introduces following changes:

  • added public function InAppChatView.EventsListener.onChatWidgetThemeChanged(widgetThemeName) to detect when Livechat widget theme is changed
  • added public variable WidgetInfo.themeNames
  • added public variable WidgetInfo.multiChannelConversationEnabled
  • renamed public variable WidgetInfo.callsAvailable to WidgetInfo.callsEnabled
  • removed public variable WidgetInfo.language
  • removed public variable InAppChatStyle.isIbDefaultTheme
  • removed public variable InAppChatToolbarStyle.isIbDefaultTheme

Migration from '11.x' to '12.x'

Since this version, minimum supported API Level is 21 (Android 5.0 - Lollipop)

To comply with security recommendations the following changes have been made to the backup policy:

Only shared preferences related to the SDK are being backed up to the cloud, along with the database. Device to device transfer is disabled to avoid registration's data processing issues. These rules can be overridden at the application level. For more information check this Backup-rules page.

usesCleartextTraffic is now disabled by default: deeplinks, web views and images should utilize https protocol. In case http needs to be enabled, in your application's AndroidManifest file override the value as following:

<application
    android:usesCleartextTraffic="true"
    tools:replace="android:usesCleartextTraffic"
    tools:targetApi="m" />

Migration from '11.0.x' to '11.1.x'

Changes for the in-app chat

Version 11.1.0 onwards introduces following changes:

  • added public function InAppChatView.EventsListener.onChatReconnected() to detect when chat is reconnected
  • removed public variable InAppChatView.isChatLoaded.

Migration from '10.x' to '11.x'

Added support for the Android 14. If your app uses gallery permissions (for example, includes in-app chat or RTC modules), then you must use READ_MEDIA_VISUAL_USER_SELECTED permission, otherwise it would run in compatibility mode.

Migration from 9.x to 10.x

Changes to the InfobipRtcUi

Because of the major release of the Infobip WebRTC SDK 2.0, content and setup exclusive of the Infobip WebRTC SDK 1.x will be deprecated on 31/10/2023. The previous WebRTC application you used must be replaced with two new separate models: CPaaS X Application and WebRTC Push Configuration.

To enable calls, you need to set up WebRTC Push configurationId and pass it to InfobipRtcUi.Builder instead of deprecated applicationId.

//old
new InfobipRtcUi.Builder(context).applicationId("Your application id");
//new
new InfobipRtcUi.Builder(context).withConfigurationId("Your push configuration id");

Version 10.0.0 onwards introduces following changes:

  • added public functions:
    • InfobipRtcUi.Builder().withConfigurationId(configurationId)
    • InfobipRtcUi.Builder().withCalls(successListener, errorListener)
    • InfobipRtcUi.Builder().withCalls(identity, listenType, successListener, errorListener)
  • renamed public functions:
    • InfobipRtcUi.Builder().customActivity() -> InfobipRtcUi.Builder().withCustomActivity()
    • InfobipRtcUi.Builder().autoDeclineOnMissingNotificationPermission() -> InfobipRtcUi.Builder().withAutoDeclineOnMissingNotificationPermission()
    • InfobipRtcUi.Builder().enableInAppCalls() -> InfobipRtcUi.Builder().withInAppChatCalls()
    • InfobipRtcUi.enableInAppCalls() -> InfobipRtcUi.enableInAppChatCalls()
  • deprecated public function:
    • InfobipRtcUi.Builder().applicationId() This function has no effect anymore.

Migration from 8.x to 9.x

Added support for the Full-Featured In-App notifications. This feature is disabled by default, check Enabling Full-featured In-Apps.

Notice: If you enabled the Full-features In-App feature, JavaScript will be enabled for the webView.

Changes to the in-app notifications

  • Original InAppView was renamed to InAppNativeView.
//old
void buttonPressedFor(@NonNull InAppView inAppView, @NonNull Message message, NotificationCategory category, @NonNull NotificationAction action);

//new
void buttonPressedFor(@NonNull InAppNativeView inAppView, @NonNull Message message, NotificationCategory category, @NonNull NotificationAction action);

Migration from 7.x to 8.x

Starting from 8.0.0 version, we introduced new possibilities in InAppChat integration and customization. Also few dependencies are needed, if you do not have them already, when you include library as @aar:

dependencies {
    ...
    implementation 'org.jetbrains.kotlin:kotlin-stdlib:+'
    implementation 'androidx.databinding:viewbinding:+'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:+'
}

Changes for the in-app chat

  • Original InAppChatView was renamed to InAppChatScreen
//old
InAppChat.getInstance(context).inAppChatView().show()
//new
InAppChat.getInstance(context).inAppChatScreen().show()

Changes for the in-app chat customizations

We introduced new approach to customize In-app chat, where we added many new attributes to be customized. Simultaneously we have deprecated old customization approach, while there is still fallback to the old customization attributes when the new ones are not present.

Deprecated approach:

<resources>
    <style name="IB_AppTheme.Chat">
        <item name="colorPrimary">@color/colorPrimary</item> <!-- DEPRECATED | color of toolbar background and send chat button tint -->
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <!-- DEPRECATED | color of status / notification bar -->
        <item name="colorControlNormal">@android:color/white</item> <!-- DEPRECATED | color of navigation icon in toolbar -->
        <item name="titleTextColor">@android:color/white</item> <!-- DEPRECATED | color of toolbar title text -->
    </style>
</resources>
<resources>
    <style name="IB_AppTheme.ChatAttach">
        <item name="colorPrimary">@color/colorPrimary</item> <!-- DEPRECATED | color of toolbar background -->
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <!-- DEPRECATED | color of status / notification bar -->
        <item name="colorControlNormal">@android:color/white</item> <!-- DEPRECATED | color of navigation icon in toolbar -->
        <item name="titleTextColor">@android:color/white</item> <!-- DEPRECATED | color of toolbar title text -->
    </style>
</resources>

is equals to new approach

<resources>
    <style name="IB_AppTheme.Chat">
        <item name="ibChatToolbarStyle">@style/InAppChat.Demo.Toolbar</item> <!-- In-app chat toolbar style -->
        <item name="ibChatAttachmentToolbarStyle">@style/InAppChat.Demo.Toolbar</item> <!-- In-app chat attachment preview toolbar style -->
    </style>

    <style name="Demo"/>

    <style name="InAppChat.Demo.Toolbar" parent="Demo">
        <item name="ibChatToolbarBackgroundColor">@color/colorPrimary</item> <!-- color of toolbar background and send chat button tint -->
        <item name="ibChatStatusBarBackgroundColor">@color/colorPrimaryDark</item> <!-- color of status / notification bar -->
        <item name="ibChatNavigationIconTint">@android:color/white</item> <!-- color of navigation icon in toolbar -->
        <item name="ibChatTitleTextColor">@android:color/white</item> <!-- color of toolbar title text -->
    </style>
</resources>

Migration from 6.x to 7.x

Starting from 7.0.0 version of the Mobile Messaging SDK Android 13 is supported, so user will be automatically asked for POST_NOTIFICATIONS permission, it is possible to trigger permission request later, for more details check Android 13 notification permission handling. Merged manifest should have this permission automatically added:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

Changes in Android SDK versions:

  • compileSdkVersion was changed from 31 to 33
  • targetSdkVersion was changed from 31 to 33

Changes for the Geofencing feature

Android 13 battery resource optimization

Changes for the in-app chat feature (Sending attachments)

New granular permissions for reading the different media types were introduced starting from Android 13, so they should be added, check the In-app chat docs

Migration from 5.x to 6.x

Starting from 6.0.0 version we've migrated library to AndroidX, changed com.google.firebase:firebase-messaging to 22.0.0 version which has some breaking changes, changed com.google.android.gms:play-services-location version to 18.0.0.

Changes in Android SDK versions:

  • minSdkVersion was changed from 14 to 16
  • compileSdkVersion was changed from 29 to 31
  • targetSdkVersion was changed from 29 to 31

Changes in registering for push notifications in Firebase:

If previously Google Services Gradle Plugin was used, you don't need to change this part. For other ways check Registration for push notifications in Firebase Documentation

Security improvements

  • We have removed deprecated ECB cryptor from our SDK, so if you have installations of the application with MobileMessaging SDK version < 5.0.0, follow this article to migrate encrypted data using the new cryptor.

  • Private shared preferences are now used by default (instead of public ones) for all MM SDK's fields, no changes in code required.

Migration to Maven Central Repository - 5.2.0 version

Due to jCenter deprecation we moved our library to Maven Central Repository. For using MobileMessaging libraries you will need make change in your build.gradle files:

Before it was looking similar to this:

repositories {
    jcenter()
    ...
}
...
dependencies {
    def mm_sdk_version = '5.0.1'
    implementation "org.infobip.mobile.messaging.api:infobip-mobile-messaging-android-chat-sdk:$mm_sdk_version@aar"
    implementation "org.infobip.mobile.messaging.api:infobip-mobile-messaging-android-geo-sdk:$mm_sdk_version@aar"
    implementation "org.infobip.mobile.messaging.api:infobip-mobile-messaging-android-resources:$mm_sdk_version@aar"
    implementation("org.infobip.mobile.messaging.api:infobip-mobile-messaging-android-sdk:$mm_sdk_version@aar") {
        transitive = true
    }

And now should be changed to this:

repositories {
    mavenCentral()
    ...
}
...
dependencies {
    def mm_sdk_version = '5.2.0'
    implementation "com.infobip:infobip-mobile-messaging-android-chat-sdk:$mm_sdk_version@aar"
    implementation "com.infobip:infobip-mobile-messaging-android-geo-sdk:$mm_sdk_version@aar"
    implementation "com.infobip:infobip-mobile-messaging-android-resources:$mm_sdk_version@aar"
    implementation("com.infobip:infobip-mobile-messaging-android-sdk:$mm_sdk_version@aar") {
        transitive = true
    }

Notice: For the case if the updating of the Mobile Messaging SDK version doesn't suits you, we've released the most popular old versions of Mobile Messaging SDK to Maven Central Repository. If you are using some other version and doesn't want to update - contact our support. Anyway, after February 1st 2022, versions from jCenter will not be available, so you need to use Maven Central Repository.

Migration from 4.x to 5.x

Encryption algorithm changed to CBC, because ECB encryption mode should not be used per Google's recommendation. Nothing needs to be changed in code, just do not downgrade from this version, or registration will be recreated.

Migration from 3.x to 4.x

If you used previously in-app chat module, method for activation of chat service should be called before opening chat screen. It will start chat service, without it chat configuration will not be updated properly. Detailed instructions in wiki

Migration from 2.x to 3.x

  • Reimport classes MobileMessagingError and Result (package name changed):
    • old: import org.infobip.mobile.messaging.mobile.MobileMessagingError;, new: import org.infobip.mobile.messaging.mobileapi.MobileMessagingError;
    • old: import org.infobip.mobile.messaging.mobile.Result;, new: import org.infobip.mobile.messaging.mobileapi.Result;
  • If you used previous chat module, it's completely rewritten and if used should be newly implemented by following guidelines provided here

Migration from 1.x to 2.x

New versions of the SDK introduced breaking changes in API. New APIs were implemented to provide support for new features as well as to imrove overall parity between the SDK, Infobip Portal and the platform. Below you should find a list of changes you will need to do in order to have same features available on the new version of the SDK.

API changes

Events API

Old name New name
REGISTRATION_CREATED REGISTRATION_CREATED event parameters changed
USER_DATA_REPORTED USER_UPDATED
USER_DATA_ACQUIRED Obsolete, use USER_UPDATED or MobileMessaging.fetchUser(...)
USER_LOGGED_OUT DEPERSONALIZED

MobileMessaging API

Old API New API
mobileMessaging.enablePushRegistration()
mobileMessaging.disablePushRegistration()
mobileMessaging.isPushRegistrationEnabled()
configure new value via installation.setPushRegistrationEnabled(...) and save installation. Get the setting via installation.isPushRegistrationEnabled(). For more details see Users and installations
mobileMessaging.getPushRegistrationId() Get the setting via installation.isPushRegistrationEnabled(). For more details see Users and installations
mobileMessaging.isPrimaryDevice
mobileMessaging.setAsPrimaryDevice()
mobileMessaging.getPrimaryDeviceSetting()
set new value via installation.setPrimaryDevice(...) and save installation. Get the value via installation.isPrimaryDevice(). For more details see Users and installations
mobileMessaging.logout(...) mobileMessaging.depersonalize(...), for more details see Users and installations
mobileMessaging.syncUserData(...) Logic was decoupled into mobileMessaging.saveUser(...) and mobileMessaging.personalize(...) methods to avoid potential problems with person merging and to clarify the intent of explicitly attaching existing device to the person, for more details see here
mobileMessaging.fetchUserData(...)
mobileMessaging.getUserData()
mobileMessaging.fetchUser(...), mobileMessaging.getUser(...) for more details see Users and installations

User API

Old API New API
UserData class User class
userData.getMsisdn() (returns String) user.getPhones() (returns Set<String>)
userData.getEmail() (returns String) user.getEmails() (returns Set<String>)
userData.getBirthdate() user.getBirthday()
userData.getPredefinedUserData() Obsolete, use User properties
userData.setCustomUserData(...)
userData.getCustomUserData(...)
userData.setCustomUserDataElement(...)
userData.getCustomUserDataValue(...)
userData.removeCustomUserDataElement(...)
This same functionality is now covered by custom attributes within Installation. Historically, the custom data was stored on the server within Destination model which is not the case now. We highly encourage you to use now custom attributes both at User and Installation level. For more details see Users and installations
Clone this wiki locally