Skip to content

MOBILE-103: new arch in Android#168

Merged
sergeysozinov merged 10 commits intonew-archfrom
feature/MOBILE-103
Apr 17, 2026
Merged

MOBILE-103: new arch in Android#168
sergeysozinov merged 10 commits intonew-archfrom
feature/MOBILE-103

Conversation

@sergeysozinov
Copy link
Copy Markdown
Collaborator

@sergeysozinov sergeysozinov changed the base branch from develop to new-arch April 17, 2026 08:02
@sergeysozinov sergeysozinov requested a review from Copilot April 17, 2026 08:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the React Native SDK and the included example app to align with React Native 0.76 / Android New Architecture (TurboModules + codegen), modernizes build tooling, and adjusts the JS↔native event wiring accordingly.

Changes:

  • Introduces a TurboModule proxy (src/NativeMindboxSdk.ts) and migrates JS to use it for native calls and event subscriptions.
  • Migrates Android native module packaging to TurboReactPackage / codegen-based module (MindboxSdkModule / MindboxSdkPackage) and updates Android build tooling.
  • Updates the example app to RN 0.76 templates/build settings and simplifies navigation by removing React Navigation.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tsconfig.json Removes a TS compiler option as part of the TS/RN tooling update.
src/index.tsx Switches JS implementation to TurboModule-based native access and event subscriptions.
src/tests/index.test.ts Updates mocks to support TurboModuleRegistry and new native surface.
src/NativeMindboxSdk.ts Adds TurboModule spec + lazy resolver proxy used by the JS wrapper.
package.json Bumps RN/Jest/TS toolchain, tightens peer deps, adds codegenConfig for TurboModules.
babel.config.js Updates Babel preset to the RN 0.76 preset package.
android/build.gradle Modernizes Android library build (AGP/Kotlin/Java 17), adds New Arch gating, configures codegen source set.
android/src/main/java/com/mindboxsdk/MindboxSdkPackage.kt Migrates package to TurboReactPackage and provides module info for TurboModules.
android/src/main/java/com/mindboxsdk/MindboxSdkModule.kt Migrates module to generated-spec base class and emits codegen events for JS.
android/src/main/java/com/mindboxsdk/MindboxJsDelivery.kt Routes push-click delivery through the new module event emission path.
android/src/main/java/com/mindboxsdk/MindboxEventSubscriber.kt Converts subscriber to Kotlin fun interface.
android/src/main/java/com/mindboxsdk/MindboxEventEmitter.kt Minor cleanup/formatting while integrating with updated delivery flow.
example/exampleApp/package.json Bumps example app to RN 0.76 and removes React Navigation deps.
example/exampleApp/src/navigation/AppNavigationContext.tsx Adds a minimal navigation context used instead of React Navigation.
example/exampleApp/src/App.tsx Replaces navigation container/stack with context-driven conditional rendering.
example/exampleApp/src/screens/HomeScreen.tsx Switches to context navigation and refactors push navigation helpers.
example/exampleApp/src/screens/NotificationCenterScreen.tsx Uses navigation context instead of injected navigation prop.
example/exampleApp/src/screens/PushNotificationScreen.tsx Adds a “Back to Home” action using navigation context.
example/exampleApp/android/settings.gradle Updates to RN 0.76 settings plugin/autolinking style.
example/exampleApp/android/gradle/wrapper/gradle-wrapper.properties Updates Gradle wrapper version.
example/exampleApp/android/gradle.properties Minor CLI comment tweak (new arch flag remains configured here).
example/exampleApp/android/build.gradle Updates Android buildscript/tool versions and aligns with RN 0.76 rootproject plugin.
example/exampleApp/android/app/build.gradle Updates app Gradle config to RN 0.76 autolinking and dependency style.
example/exampleApp/android/app/src/main/java/com/exampleapp/MainApplication.kt Updates Application wiring for RN 0.76 / New Arch host setup.
example/exampleApp/android/app/src/main/java/com/exampleapp/MainActivity.kt Updates intent delivery logic for both New Arch and Old Arch startup flows.
example/exampleApp/ios/exampleApp/PrivacyInfo.xcprivacy Expands privacy manifest entries for accessed APIs / tracking keys.
example/exampleApp/ios/exampleApp.xcodeproj/project.pbxproj Raises iOS deployment target and adjusts Swift compilation conditions.
example/exampleApp/ios/Podfile Updates Podfile script loading and formatting consistent with newer templates.
Comments suppressed due to low confidence (2)

example/exampleApp/android/settings.gradle:16

  • includeBuild("../node_modules/@react-native/gradle-plugin") is declared twice (inside pluginManagement and again at the bottom). This duplication can cause Gradle warnings or plugin resolution issues; keep only the pluginManagement one (the bottom includeBuild is typically unnecessary).
rootProject.name = "exampleApp"
include(":app")
includeBuild("../node_modules/@react-native/gradle-plugin")

src/index.tsx:300

  • onPushClickReceived now subscribes via MindboxSdkNative.onPushNotificationClicked, but iOS currently emits pushNotificationClicked from the separate MindboxJsDelivery event emitter module. Without a platform-specific fallback (or an iOS TurboModule event), this listener will be undefined on iOS and push click handling will break.
  public onPushClickReceived(callback: (pushUrl: string | null, pushPayload: string | null) => void) {
    if (!callback || typeof callback !== 'function') {
      this.writeNativeLog('PushClick callback is not set', LogLevel.ERROR)
      throw new Error('callback is required!')
    }

    this.removeOnPushClickReceived()
    this.writeNativeLog('Set push click listener', LogLevel.INFO)

    this._pushSubscription = MindboxSdkNative.onPushNotificationClicked((event: PushNotificationClickedPayload) => {
      callback(event.pushUrl || null, event.pushPayload || null)
    })

    if (Platform.OS === 'android') {
      this.writeNativeLog('Register push click listener for android', LogLevel.INFO)
      MindboxSdkNative.onPushClickedIsRegistered(true)
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/NativeMindboxSdk.ts
Comment thread android/src/main/java/com/mindboxsdk/MindboxJsDelivery.kt
Comment thread android/src/main/java/com/mindboxsdk/MindboxSdkModule.kt
Comment thread src/index.tsx
Comment thread android/build.gradle
Comment thread android/build.gradle
Comment thread .github/workflows/lint_and_test.yml
@sergeysozinov sergeysozinov merged commit 8ea1d3b into new-arch Apr 17, 2026
4 checks passed
@sergeysozinov sergeysozinov deleted the feature/MOBILE-103 branch April 17, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants