Skip to content

Migration guide

Jakub Dzubak edited this page May 2, 2024 · 14 revisions

Migration from '6.2.x' to '6.3.x'

Changes for the in-app chat

Version 6.3.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 5.x to 6.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 4.x to 5.x

Changes for the in-app chat

Version 5.0.0 onwards introduces following changes:

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

Migration from 3.x to 4.x

Starting from 4.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 2.x to 3.x

Starting from 3.0.0-rc version we've migrated library to AndroidX, changed com.huawei.agconnect:agcp to 1.6.0.300 version which has some breaking changes. For release version 3.0.0 we've added back geofencing module and updated com.huawei.hms:location to 6.8.0.300 version, please check Geofencing docs to see the required permissions and options for requesting them properly.

Changes in Android SDK versions:

  • minSdkVersion was changed from 17 to 19
  • compileSdkVersion was changed from 28 to 33
  • targetSdkVersion was changed from 28 to 33

Changes for Geofencing feature:

In this version location permissions are provided, so merged manifest should have this permission automatically added:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

For more information about Geofencing usage, please check Geofencing docs

Security improvements

  • We have removed deprecated ECB cryptor from our SDK, so if you have installations of the application with MobileMessaging SDK version < 2.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 - 2.1.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 = '2.0.0'
    implementation ('org.infobip.mobile.messaging.api:infobip-mobile-messaging-huawei-sdk:$mm_sdk_version@aar') {
        transitive = true
    }
    implementation "org.infobip.mobile.messaging.api:infobip-mobile-messaging-huawei-chat-sdk:$mm_sdk_version@aar"
    implementation "org.infobip.mobile.messaging.api:infobip-mobile-messaging-huawei-geo-sdk:$mm_sdk_version@aar"
}

And now should be changed to this:

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

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 1.x to 2.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.