Skip to content

Commit 1f644e9

Browse files
chore: update example to use RN v0.83 goodies
1 parent 6b24e48 commit 1f644e9

4 files changed

Lines changed: 400 additions & 1114 deletions

File tree

example/ios/MendixNativeExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
389389
SDKROOT = iphoneos;
390390
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
391+
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
391392
USE_HERMES = true;
392393
};
393394
name = Debug;
@@ -460,6 +461,7 @@
460461
);
461462
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
462463
SDKROOT = iphoneos;
464+
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
463465
USE_HERMES = true;
464466
VALIDATE_PRODUCT = YES;
465467
};

example/ios/MendixNativeExample/AppDelegate.swift

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,22 @@
11
import UIKit
22
import React
3-
import React_RCTAppDelegate
4-
import ReactAppDependencyProvider
53
import MendixNative
64

75
@main
8-
class AppDelegate: RCTAppDelegate {
6+
class AppDelegate: ReactAppProvider {
97

108
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
119

12-
self.moduleName = "App"
13-
self.dependencyProvider = RCTAppDependencyProvider()
14-
self.initialProps = [:]
15-
super.application(application, didFinishLaunchingWithOptions: launchOptions)
16-
17-
//Start - For MendixApplication compatibility only, not part of React Native template
1810
SessionCookieStore.restore()
11+
setUpProvider()
1912

2013
guard let bundleUrl = bundleURL() else {
2114
let message = "No script URL provided. Make sure the metro packager is running or you have embedded a JS bundle in your application bundle."
2215
NativeErrorHandler().handle(message: message, stackTrace: [])
2316
return false
2417
}
2518

26-
MxConfiguration.update(from:
19+
ReactNative.shared.setup(
2720
MendixApp.init(
2821
identifier: nil,
2922
bundleUrl: bundleUrl,
@@ -34,17 +27,18 @@ class AppDelegate: RCTAppDelegate {
3427
splashScreenPresenter: nil,
3528
reactLoading: nil,
3629
enableThreeFingerGestures: false
37-
)
30+
),
31+
launchOptions: launchOptions
3832
)
39-
//End - For MendixApplication compatibility only, not part of React Native template
40-
return true
33+
ReactNative.shared.start()
34+
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
4135
}
4236

43-
override func applicationDidEnterBackground(_ application: UIApplication) {
37+
func applicationDidEnterBackground(_ application: UIApplication) {
4438
SessionCookieStore.persist()
4539
}
4640

47-
override func applicationWillTerminate(_ application: UIApplication) {
41+
func applicationWillTerminate(_ application: UIApplication) {
4842
SessionCookieStore.persist()
4943
}
5044

example/ios/Podfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ if linkage != nil
1616
use_frameworks! :linkage => linkage.to_sym
1717
end
1818

19+
ENV['RCT_USE_RN_DEP'] = '1'
20+
ENV['RCT_USE_PREBUILT_RNCORE'] = '1'
21+
1922
target 'MendixNativeExample' do
2023
config = use_native_modules!
2124

0 commit comments

Comments
 (0)