Skip to content

Commit dd6ec99

Browse files
committed
chore: add support for RN 0.79 to sample app
1 parent 78c1822 commit dd6ec99

File tree

6 files changed

+2546
-1932
lines changed

6 files changed

+2546
-1932
lines changed

examples/SampleApp/Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ gem 'concurrent-ruby', '< 1.3.4'
1111
gem 'fastlane'
1212
gem 'rubocop-performance'
1313
gem 'rubocop-require_tools'
14+
gem 'bigdecimal'
15+
gem 'logger'
16+
gem 'benchmark'
17+
gem 'mutex_m'
1418

1519
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
1620
eval_gemfile(plugins_path) if File.exist?(plugins_path)

examples/SampleApp/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

examples/SampleApp/ios/AppDelegate.swift

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,42 @@ import FirebaseCore
66
import FirebaseMessaging
77

88
@main
9-
class AppDelegate: RCTAppDelegate {
10-
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
11-
self.moduleName = "SampleApp"
12-
self.dependencyProvider = RCTAppDependencyProvider()
13-
FirebaseApp.configure()
9+
class AppDelegate: UIResponder, UIApplicationDelegate {
10+
var window: UIWindow?
11+
12+
var reactNativeDelegate: ReactNativeDelegate?
13+
var reactNativeFactory: RCTReactNativeFactory?
14+
15+
func application(
16+
_ application: UIApplication,
17+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
18+
) -> Bool {
19+
let delegate = ReactNativeDelegate()
20+
let factory = RCTReactNativeFactory(delegate: delegate)
21+
delegate.dependencyProvider = RCTAppDependencyProvider()
22+
FirebaseApp.configure()
23+
24+
reactNativeDelegate = delegate
25+
reactNativeFactory = factory
26+
27+
window = UIWindow(frame: UIScreen.main.bounds)
28+
29+
factory.startReactNative(
30+
withModuleName: "SampleApp",
31+
in: window,
32+
launchOptions: launchOptions
33+
)
34+
35+
return true
36+
}
1437

15-
// You can add your custom initial props in the dictionary below.
16-
// They will be passed down to the ViewController used by React Native.
17-
self.initialProps = [:]
18-
19-
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
20-
}
21-
22-
override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
38+
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
2339
// Pass the device token to FCM
2440
Messaging.messaging().apnsToken = deviceToken
2541
}
42+
}
2643

44+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
2745
override func sourceURL(for bridge: RCTBridge) -> URL? {
2846
self.bundleURL()
2947
}

0 commit comments

Comments
 (0)