Skip to content

Migration guides

Alexander Boldyrev edited this page Oct 31, 2024 · 14 revisions

Migration from 12.2.x to 12.3.x

As of this version Geofencing feature has been removed.

If you used this feature you might have geo messages table remain in the device's database. To remove it consult Android SDK documentation.

Scheduled jobs for Geofencing are no longer supported, more info in Android SDK documentation.

Migration from 11.0.x to 12.0.x

Since this version we've added support for Inbox.

Migration from 10.0.x to 11.0.x

Changes for library events

From version 11.0.0 onwards, library events no longer contain eventName in the event body. You need to implement distinguished subscriptions to the required events, as described in Library events.

Migration from 9.4.x to 10.0.x

Since this version we've added support for In-App messages.

Migration from 9.3.x to 9.4.x

Changes for Android

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 9.2.x to 9.3.x

Changes for Android: Geofencing usage

Geofencing is disabled by default starting from this version. In order to enable usage of Geofencing you need to set withGeofencingModule to true in your build.gradle.

buildscript {
    ext {
        ...
        withGeofencingModule = true
    }

Migration from 8.x to 9.x

Changes for the webRTCUI

Because the major release of Infobip WebRTC SDK 2.0, content and setup exclusive of 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: WebRTC Application and WebRTC Push Configuration.

To enable calls you need to set up WebRTC Push configurationId and pass it to configuration object instead of deprecated applicationId.

Replace old configuration:

configuration = {
    ...
    webRTCUI: {
        applicationId: 'your webrtc application id'
    },
    ...
};

with new:

configuration = {
    ...
    webRTCUI: {
        configurationId: 'your webrtc configuration id'
    },
    ...
};

Migration from 8.3.x to 8.4.x

If you used customization previously, you will need to replace:

mobileMessaging.setupiOSChatSettings({
        title: 'Chat title',
        sendButtonColor: '#FF0000',
        navigationBarItemsColor: '#FF0000',
        navigationBarColor: '#FFFF00',
        navigationBarTitleColor: '#FF0000',
})

with:

MobileMessaging.setupChatSettings(
	toolbarTitle: 'Chat title',
    sendButtonTintColor: '#FF0000',
    toolbarTintColor: '#FF0000',
    toolbarBackgroundColor: '#FFFF00',
    toolbarTitleColor: '#FF0000',
)

this settings will be applied for both platform instead of iOS only.

Notice:

If you used Android settings in the styles.xml or string.xml, they will be overridden by Mobile Messaging.setupChatSettings method.

Migration from 7.x to 8.x

Support for RN 0.70.7 version was introduced and iOS minimum deployment target changed to 12.4.

Migration from 6.x to 7.x

Added option to register to POST_NOTIFICATIONS permission for Android 13. Added multi-threading feature for in-app chat.

Changes in Android SDK versions:

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

Migration from 6.1.0 to 6.2.0, in case you are getting rid of use_frameworks! in the Podfile

Starting from the 6.2.0 plugin version it's not mandatory to have use_frameworks! in the Podfile. If you want to get rid of use_frameworks! you need to :

  1. Remove use_frameworks! from the Podfile, then from the ios folder call pod deintegrate & pod update.
  2. Perform mmine integrate command from the guide about Notification Extension Integration
  3. Make cleanup from the xCode Product->Clean Build Folder and remove Derived Data rm -rf ~/Library/Developer/Xcode/DerivedData/*

Notice:

Manual plugin integration for iOS is deprecated, because plugin can be integrated without use_frameworks!. If you have used Manual integration before, you need to follow the recommendations of how to return back to automatic integration and then Setup xcode project for Notification Extension.

Migration from 5.x to 6.x

Starting from 6.0.0 version we updated react-native to 0.68.0. However New react-native architecture features aren't supported yet, so for Android platform in newArchEnabled=false should be set into gradle.properties, and the flag RCT_NEW_ARCH_ENABLED shouldn't be set for iOS platform. To migrate application you can use react-native upgrade helper or just re-create application from scratch using particular react-native version (react-native init newproject --version 0.68.0).

Changes for Android platform

We've migrated Android MobileMessaging SDK used within the plugin 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:

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

Changes in registering for push notifications in Firebase:

Please check Registration for push notifications in Firebase documentation

Security improvements

Starting from 6.0.0 version we removed deprecated ECB cryptor from our Android MobileMessaging SDK, so if you have installations of the application with MobileMessaging plugin version < 3.0.0 (it actually means that data encrypted with old algorithm needs to be migrated), add withCryptorMigration = true into android/build.gradle extra properties:

buildscript {
    ext {
        ...
        withCryptorMigration = true
    }

Additionally you can check how it's set in Example app.

Geofencing changes

Additionally following permissions will be added automatically to the AndroidManifest.xml:

    <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" />

In case you aren't using geo, you can add it to the /android/app/src/main/AndroidManifest.xml so permissions won't be requested:

<manifest ... xmlns:tools="http://schemas.android.com/tools">
    ...    
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove"  />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove"  />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove"  />
    ...
</manifest>

Procedure of requesting permissions changed, please check Geofencing guide for Android.

Migration from 4.x to 5.x

Starting from 5.0.0 version we updated react-native to 0.66.3. To migrate application you can use react-native upgrade helper or just re-create application from scratch using particular react-native version (react-native init newproject --version 0.66.3).

Deprecations:

  • register(eventName, handler) is deprecated, for react-native version >= 0.65 subscribe(eventName, handler) : EmitterSubscription should be used.
  • unregister(eventName, handler) is deprecated, for react-native version >= 0.65 unsubscribe(subscription) should be used.
  componentDidMount() {
-      mobileMessaging.register(event, this.handleMobileMessagingEvent);
+      this.subscription = mobileMessaging.subscribe("notificationTapped", this.handleMobileMessagingEvent);
  }

  componentWillUnmount() {
-      mobileMessaging.unregister(event, this.handleMobileMessagingEvent);
+      mobileMessaging.unsubscribe(this.subscription);
  }

Migration from 3.x to 4.x

Starting from 4.0.0 version we updated react-native to 0.64.2. To migrate application you can use react-native upgrade helper or just re-create application from scratch using particular react-native version (react-native init newproject --version 0.64.2).

You may face cycle in dependencies between targets '<Your main target>' and 'FBReactNativeSpec' error while building project for iOS, it's known react-native issue, we solved it for our Example project by adding following to Podfile:

target 'Example' do
  ...
  post_install do |installer|
    react_native_post_install(installer)
    
    #fix for issue https://github.com/facebook/react-native/issues/31034
    installer.pods_project.targets.each do |target|
        if (target.name&.eql?('FBReactNativeSpec'))
          target.build_phases.each do |build_phase|
            if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
              target.build_phases.move(build_phase, 0)
            end
          end
        end
      end
    #end of fix

  end
end
Clone this wiki locally