Switching Between React Native Architectures - infobip/mobile-messaging-react-native-plugin GitHub Wiki

Switching Between React Native Architectures

The plugin supports both the legacy bridge architecture and the new architecture (TurboModules/Fabric). You can switch between architectures depending on your needs.

Android

In order to switch between new and legacy architecture, you can do it by changing the flag in your apps gradle.properties file.

Enable new architecture

newArchEnabled=true

Disable new architecture (legacy bridge)

newArchEnabled=false

After changing this flag clean the build of application:

cd android && ./gradlew clean

Reinstall and run the app.

iOS

In order to switch between new and legacy architecture, you can do it by changing the two flags in your apps Podfile file. You need to change the values of RCT_NEW_ARCH_ENABLED and new_arch_enabled.

Notice

It is important that values of both flags should match (either enabled or disabled).

Enable new architecture

ENV['RCT_NEW_ARCH_ENABLED'] = '1'  # Enable new architecture
    ...
use_react_native!(
    ...
:new_arch_enabled => true,  # Enable new architecture
)

Disable new architecture (legacy bridge)

ENV['RCT_NEW_ARCH_ENABLED'] = '0'  # Disable new architecture (legacy)
    ...
use_react_native!(
    ...
:new_arch_enabled => fasle,  # Disable new architecture (use legacy)
)

After changing these values: Run:

cd ios && pod install

Rebuild and run the app