feat: [SDK-4157] add React Native New Architecture support (TurboModules)#1920
Merged
fadi-george merged 25 commits intomainfrom Mar 18, 2026
Conversation
|
@fadi-george how sure are we that this works well for us? with the entire architecture update |
Collaborator
Author
Device support would be depedent on the Android SDK so still Android 6.0+ (API 24). |
8188d28 to
ee4d7c6
Compare
nan-li
reviewed
Mar 17, 2026
ee4d7c6 to
b043706
Compare
nan-li
approved these changes
Mar 18, 2026
38f670e to
891680c
Compare
00a99db to
b34904c
Compare
5090bef to
cf81d92
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Migrate the SDK to React Native's New Architecture using TurboModules, Fabric, and Bridgeless Mode, dropping legacy Bridge support.
Details
Motivation
React Native 0.76+ enables the New Architecture by default. The SDK needed native TurboModule support to work correctly with apps using TurboModules, Fabric renderer, and Bridgeless Mode. This is tracked in #1675 and SDK-4157.
Implementation follows the official Turbo Native Modules guide from the React Native working group, including the event emitter pattern using
CodegenTypes.EventEmitter.Scope
This is a breaking change (v6.0.0). The minimum React Native version is now 0.76.0.
What changed:
NativeOneSignal.tsTurboModule spec with codegen configurationRNOneSignal.javaextends codegen-generatedNativeOneSignalSpec, package registration usesBaseReactPackage.mto.mm, module extendsNativeOneSignalSpecBase, implementsgetTurboModule:for JSI registrationNativeEventEmittertoCodegenTypes.EventEmitterwith directonXxxsubscriptions#ifdef RCT_NEW_ARCH_ENABLEDconditionals (legacy arch no longer supported)getPushSubscriptionId,getPushSubscriptionToken,getOptedIn,hasPermission)addTags,addAliases,addTriggers) now useRecord<string, string>typesglobalThisto prevent duplicate event subscriptionsWhat is not affected:
Testing
Unit testing
All 246 unit tests pass. Tests updated to mock
TurboModuleRegistryand codegen-generated event emitters instead ofNativeModulesandNativeEventEmitter.Manual testing
Tested on iOS simulator and Android emulator with the demo app covering initialization, push permission, notifications (foreground/background/click), login/logout, tags, aliases, email/SMS, IAM triggers, outcomes, and event observers.
cd into
examples/demoand run eitherbun run iosorbun run android.Affected code checklist
Checklist
Overview
Testing
Final pass
This change is