Skip to content

Commit 4fb5a20

Browse files
Merge pull request #11 from rn-bridge/rn-0.79
React native upgrade to 0.79
2 parents 3b422dd + 7484bfd commit 4fb5a20

File tree

15 files changed

+1790
-1728
lines changed

15 files changed

+1790
-1728
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ Add the following line to your App's `Bridging-Header.h`
5959

6060
> [!IMPORTANT]
6161
> A Bridging Header is required in iOS development when you want to use Objective-C code in a Swift project.
62+
> Add your bridging header to Objective-C Bridging Header under Swift Compiler-General (Target -> Build Settings -> Swift Compiler-General -> Objective-C Bridging Header)
63+
<img width="809" alt="Screenshot 2025-05-20 at 10 28 01 PM" src="https://github.com/user-attachments/assets/6817709a-7623-4bc7-8c50-79ff26ba8069" />
64+
6265
```objective-c
6366
#import "RNShortcuts.h"
6467
```

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

android/gradlew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
# Darwin, MinGW, and NonStop.
5858
#
5959
# (3) This script is generated from the Groovy template
60-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
6161
# within the Gradle project.
6262
#
6363
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

example/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
88
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
99
gem 'xcodeproj', '< 1.26.0'
1010
gem 'concurrent-ruby', '< 1.3.4'
11+
12+
# Ruby 3.4.0 has removed some libraries from the standard library.
13+
gem 'bigdecimal'
14+
gem 'logger'
15+
gem 'benchmark'
16+
gem 'mutex_m'

example/Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ GEM
8282
logger (1.6.6)
8383
minitest (5.25.4)
8484
molinillo (0.8.0)
85+
mutex_m (0.3.0)
8586
nanaimo (0.3.0)
8687
nap (1.1.0)
8788
netrc (0.11.0)
@@ -107,8 +108,12 @@ PLATFORMS
107108

108109
DEPENDENCIES
109110
activesupport (>= 6.1.7.5, != 7.1.0)
111+
benchmark
112+
bigdecimal
110113
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
111114
concurrent-ruby (< 1.3.4)
115+
logger
116+
mutex_m
112117
xcodeproj (< 1.26.0)
113118

114119
RUBY VERSION

example/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

example/android/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

example/ios/AppDelegate.swift

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,52 @@ import UIKit
22
import React
33
import React_RCTAppDelegate
44
import ReactAppDependencyProvider
5-
5+
66
@main
7-
class AppDelegate: RCTAppDelegate {
8-
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
9-
self.moduleName = "ReactNativeShortcutsExample";
10-
self.dependencyProvider = RCTAppDependencyProvider()
11-
12-
// You can add your custom initial props in the dictionary below.
13-
// They will be passed down to the ViewController used by React Native.
14-
self.initialProps = [:]
15-
16-
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
7+
class AppDelegate: UIResponder, UIApplicationDelegate {
8+
var window: UIWindow?
9+
10+
var reactNativeDelegate: ReactNativeDelegate?
11+
var reactNativeFactory: RCTReactNativeFactory?
12+
13+
func application(
14+
_ application: UIApplication,
15+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
16+
) -> Bool {
17+
let delegate = ReactNativeDelegate()
18+
let factory = RCTReactNativeFactory(delegate: delegate)
19+
delegate.dependencyProvider = RCTAppDependencyProvider()
20+
21+
reactNativeDelegate = delegate
22+
reactNativeFactory = factory
23+
24+
window = UIWindow(frame: UIScreen.main.bounds)
25+
26+
factory.startReactNative(
27+
withModuleName: "ReactNativeShortcutsExample",
28+
in: window,
29+
launchOptions: launchOptions
30+
)
31+
32+
return true
1733
}
18-
34+
35+
func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
36+
RNShortcuts.handle(shortcutItem)
37+
completionHandler(true)
38+
}
39+
}
40+
41+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
1942
override func sourceURL(for bridge: RCTBridge) -> URL? {
2043
self.bundleURL()
2144
}
22-
45+
2346
override func bundleURL() -> URL? {
2447
#if DEBUG
2548
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
2649
#else
2750
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
2851
#endif
2952
}
30-
31-
override func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
32-
RNShortcuts.handle(shortcutItem)
33-
completionHandler(true)
34-
}
35-
3653
}

0 commit comments

Comments
 (0)