Skip to content

Commit 15919a8

Browse files
refactor: update AppDelegate to use bundleURL method and clean up ReactAppProvider
fix: add .harness to .gitignore and update jest.config.js for consistency
1 parent 73951b4 commit 15919a8

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,6 @@ lib/
9090

9191
# Fastlane.swift runner binary
9292
**/fastlane/FastlaneRunner
93+
94+
# Harness logs/crash reports
95+
example/.harness

example/.harness/manifest.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

example/ios/MendixNativeExample/AppDelegate.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class AppDelegate: ReactAppProvider {
77

88
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
99
setUpProvider()
10-
guard let bundleUrl = reactNativeDelegate?.bundleURL() else {
10+
guard let bundleUrl = bundleURL() else {
1111
let message = "No script URL provided. Make sure the metro packager is running or you have embedded a JS bundle in your application bundle."
1212
fatalError(message)
1313
}
@@ -30,4 +30,12 @@ class AppDelegate: ReactAppProvider {
3030
ReactNative.shared.start()
3131
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
3232
}
33+
34+
func bundleURL() -> URL? {
35+
#if DEBUG
36+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
37+
#else
38+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
39+
#endif
40+
}
3341
}

example/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
forceExit: true,
23
projects: [
34
{
45
displayName: 'react-native-harness',

ios/Modules/Helper/ReactAppProvider.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ open class ReactAppProvider: UIResponder, UIApplicationDelegate {
6767
return window?.rootViewController?.view
6868
}
6969

70-
// Check if React Native app is active and running
7170
public static func isReactAppActive() -> Bool {
7271
return ReactHostHelper().isReactAppActive()
7372
}

0 commit comments

Comments
 (0)