Adding React Native to Signal Open Source App: Part 1 (iOS)
Article Summary
Mariusz Stanisz from Software Mansion just proved brownfield React Native integration doesn't have to be scary. He added RN to Signal's notoriously complex iOS codebase and documented every step.
This is a detailed walkthrough of integrating React Native into Signal's open source iOS app. Stanisz tackles the unique challenges of brownfield integration, from dependency management to AppDelegate inheritance, showing how each app requires a different approach beyond standard documentation.
Key Takeaways
- Only 4 core files needed: package.json, metro.config.js, index.js, and App.tsx
- AppDelegate must inherit from RCTAppDelegate despite Signal's complex existing structure
- Signal's Pods were in remote repo, requiring .gitignore changes and platform bump to 15.1
- Swapped new chat button logic to launch RN view with hot reload working
- Gemfile and Podfile updates align Ruby dependencies with RN requirements
Brownfield React Native integration into Signal iOS required careful AppDelegate inheritance and dependency wrangling, but ultimately worked with just core RN files and targeted Swift changes.
About This Article
Signal's iOS codebase needed AppDelegate to inherit from RCTAppDelegate. This meant Mariusz Stanisz had to override several methods while keeping the existing functionality intact and making sure the app didn't break.
Software Mansion selectively overrode methods in AppDelegate, focusing on application(_:didFinishLaunchingWithOptions:). They also added sourceURL and bundleURL implementations based on React Native's documentation.
The integration turned on hot reload and got the Metro bundler working properly. React Native screens could now launch from Signal's native chat interface by swapping a single button in ChatListViewController.swift.