Skip to content

MOBILE-104: Add support new arch for iOS#170

Merged
sergeysozinov merged 5 commits intonew-archfrom
feature/MOBILE-104
Apr 28, 2026
Merged

MOBILE-104: Add support new arch for iOS#170
sergeysozinov merged 5 commits intonew-archfrom
feature/MOBILE-104

Conversation

@sergeysozinov
Copy link
Copy Markdown
Collaborator

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 migrates the iOS side of the Mindbox React Native SDK to React Native’s New Architecture (TurboModules/codegen), updates the example app accordingly, and simplifies the JS API surface around push tokens.

Changes:

  • iOS: replace the old Swift + RCT_EXTERN_MODULE bridge with a New-Arch TurboModule (MindboxSdk.mm/.h) backed by a Swift implementation (MindboxSdkImpl.swift) and a new-arch build guard.
  • JS/Android: remove deprecated single-token APIs and rely on the unified getTokens() path; adjust push-click listener registration to be platform-agnostic.
  • Update tests and the example iOS app to the new React Native app delegate setup.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/index.tsx Removes deprecated token APIs and makes push-click registration unconditional via TurboModule method.
src/tests/index.test.ts Updates mocks/tests to reflect removal of legacy token APIs and new getTokens() behavior.
src/NativeMindboxSdk.ts Updates TurboModule spec to remove legacy token methods and define events.
android/src/main/java/com/mindboxsdk/MindboxSdkModule.kt Removes getFMSToken/updateFMSToken native implementations in line with updated spec.
ios/MindboxSdkNewArchGuard.mm Adds a compile-time guard intended to enforce RN New Architecture.
ios/MindboxSdkImpl.swift New Swift implementation backing the TurboModule and event bridging logic.
ios/MindboxSdk.mm New ObjC++ TurboModule implementation that wires Swift impl and event emission + getTurboModule.
ios/MindboxSdk.h New TurboModule header tying into codegen (MindboxSdkSpec).
ios/MindboxJsDelivery.swift Replaces ObjC emitter with a Swift helper that forwards push/in-app events to MindboxSdkImpl.
ios/MindboxJsDeliveryBridge.swift Bridge helper to expose Swift delivery emitter to ObjC/Swift call sites.
ios/MindboxSdk.xcodeproj/project.pbxproj Updates Xcode project sources/refs for the new file layout and removal of bridging header.
ios/MindboxSdk.swift Removes old Swift module implementation (legacy bridge).
ios/MindboxSdk.m Removes old RCT_EXTERN_MODULE declarations (legacy bridge).
ios/MindboxSdk-Bridging-Header.h Removes legacy bridging header.
ios/MindboxJsDelivery.m Removes legacy ObjC RCTEventEmitter-based delivery emitter.
ios/MindboxJsDelivery.h Removes legacy ObjC header for the delivery emitter.
MindboxSdk.podspec Updates iOS deployment target and RN dependency installation approach for new arch.
example/exampleApp/ios/AppDelegate.swift Migrates example app delegate to RCTAppDelegate-based setup and keeps Mindbox integrations.
example/exampleApp/ios/exampleApp.xcodeproj/project.pbxproj Removes unused Swift file ref and aligns project file list.
example/exampleApp/ios/Swift.swift Removes unused placeholder Swift file.
Comments suppressed due to low confidence (1)

src/index.tsx:187

  • This PR removes the public JS methods getToken and updateToken from the SDK surface. Since package.json still reports version 2.15.0, this is a semver-breaking change for consumers who still call the deprecated APIs. Either keep the methods (even as wrappers) until a major release, or bump the package major version / document the breaking change clearly in the changelog.
  /**
   * @name getTokens
   * @description Requires a callback that will return FMS (Android) / APNS (iOS) token .
   * method return jsin string like {"FCM":"token1","HMS":"token2","RuStore":"token3"}
   * @param {function(token: String): void} callback Callback will return FMS/HCM/RuStore (Android) / APNS (iOS) token
   * @example
   * MindboxSdk.getTokens((token: string) => { ... });
   */
  public getTokens(callback: (token: string) => void) {
    if (!callback || typeof callback !== 'function') {
      throw new Error('callback is required!')
    }

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

Comment thread MindboxSdk.podspec Outdated
Comment thread ios/MindboxSdkNewArchGuard.mm
Comment thread ios/MindboxSdkImpl.swift Outdated
Comment thread ios/MindboxSdkImpl.swift Outdated
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 migrates the Mindbox React Native iOS integration to React Native New Architecture (TurboModules/codegen) and removes legacy bridge-based APIs, aligning the SDK with RN >=0.76.0.

Changes:

  • Replaced the legacy iOS bridge module with a New Architecture implementation (MindboxSdk.mm + MindboxSdkImpl.swift) and added a compile-time guard requiring RCT_NEW_ARCH_ENABLED=1.
  • Removed deprecated token APIs (getToken, updateToken, getFMSToken, updateFMSToken) and updated JS + tests accordingly.
  • Updated the example iOS app to use RCTAppDelegate and adjusted iOS CocoaPods configuration for the new architecture.

Reviewed changes

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

Show a summary per file
File Description
src/index.tsx Removes deprecated token methods; registers push-click listener for all platforms via onPushClickedIsRegistered.
src/tests/index.test.ts Updates mocks/expectations to match removed token methods and new getTokens payload shape.
src/NativeMindboxSdk.ts Updates TurboModule spec to remove FMS methods; keeps lazy TurboModule resolution via Proxy.
ios/MindboxSdkNewArchGuard.mm Enforces New Architecture at compile time for iOS builds.
ios/MindboxSdkImpl.swift New Swift implementation backing the New Arch module (init, tokens, operations, event dispatch).
ios/MindboxSdk.mm New ObjC++ TurboModule wrapper bridging to MindboxSdkImpl and codegen JSI module.
ios/MindboxSdk.h New header wiring in the codegen spec base/protocol.
ios/MindboxJsDelivery.swift Replaces legacy event emitter delivery logic with direct emission into MindboxSdkImpl.
ios/MindboxSdk.xcodeproj/project.pbxproj Updates iOS project sources to new files; removes bridging header usage.
ios/MindboxSdk.swift Removes legacy Swift bridge module implementation.
ios/MindboxSdk.m Removes legacy extern module declarations.
ios/MindboxSdk-Bridging-Header.h Removes obsolete bridging header.
ios/MindboxJsDelivery.m Removes legacy Objective-C event emitter implementation.
ios/MindboxJsDelivery.h Removes legacy Objective-C event emitter header.
android/src/main/java/com/mindboxsdk/MindboxSdkModule.kt Removes deprecated FMS methods and related subscription tracking.
MindboxSdk.podspec Raises iOS minimum version and switches dependency setup to install_modules_dependencies(s).
example/exampleApp/ios/exampleApp.xcodeproj/project.pbxproj Removes an unused Swift file from the example Xcode project.
example/exampleApp/ios/Swift.swift Deletes unused placeholder Swift file from the example app.
example/exampleApp/ios/AppDelegate.swift Migrates example app delegate to RCTAppDelegate and New Arch-style overrides.

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

Comment thread ios/MindboxSdk.h Outdated
Comment thread example/exampleApp/ios/AppDelegate.swift
Comment thread example/exampleApp/ios/AppDelegate.swift
Comment thread MindboxSdk.podspec
Comment thread MindboxSdk.podspec
Comment thread ios/MindboxSdkImpl.swift Outdated
@sergeysozinov sergeysozinov requested a review from justSmK April 28, 2026 09:38
@sergeysozinov sergeysozinov merged commit bf710b1 into new-arch Apr 28, 2026
4 checks passed
@sergeysozinov sergeysozinov deleted the feature/MOBILE-104 branch April 28, 2026 15:15
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