Skip to content

Commit 3cd6007

Browse files
feat: iOS integration
1 parent b22f7bc commit 3cd6007

28 files changed

Lines changed: 984 additions & 501 deletions

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby ">= 2.7.8"
4+
ruby ">= 2.6.10"
55

66
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7-
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
7+
gem 'cocoapods', '= 1.16.2'
88
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9-
gem 'xcodeproj', '< 1.26.0'
9+
gem 'xcodeproj', '>= 1.27.0'
1010
gem 'concurrent-ruby', '< 1.3.4'

Gemfile.lock

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (7.2.2.2)
9+
base64
10+
benchmark (>= 0.3)
11+
bigdecimal
12+
concurrent-ruby (~> 1.0, >= 1.3.1)
13+
connection_pool (>= 2.2.5)
14+
drb
15+
i18n (>= 1.6, < 2)
16+
logger (>= 1.4.2)
17+
minitest (>= 5.1)
18+
securerandom (>= 0.3)
19+
tzinfo (~> 2.0, >= 2.0.5)
20+
addressable (2.8.7)
21+
public_suffix (>= 2.0.2, < 7.0)
22+
algoliasearch (1.27.5)
23+
httpclient (~> 2.8, >= 2.8.3)
24+
json (>= 1.5.1)
25+
atomos (0.1.3)
26+
base64 (0.3.0)
27+
benchmark (0.5.0)
28+
bigdecimal (3.3.1)
29+
claide (1.1.0)
30+
cocoapods (1.16.2)
31+
addressable (~> 2.8)
32+
claide (>= 1.0.2, < 2.0)
33+
cocoapods-core (= 1.16.2)
34+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
35+
cocoapods-downloader (>= 2.1, < 3.0)
36+
cocoapods-plugins (>= 1.0.0, < 2.0)
37+
cocoapods-search (>= 1.0.0, < 2.0)
38+
cocoapods-trunk (>= 1.6.0, < 2.0)
39+
cocoapods-try (>= 1.1.0, < 2.0)
40+
colored2 (~> 3.1)
41+
escape (~> 0.0.4)
42+
fourflusher (>= 2.3.0, < 3.0)
43+
gh_inspector (~> 1.0)
44+
molinillo (~> 0.8.0)
45+
nap (~> 1.0)
46+
ruby-macho (>= 2.3.0, < 3.0)
47+
xcodeproj (>= 1.27.0, < 2.0)
48+
cocoapods-core (1.16.2)
49+
activesupport (>= 5.0, < 8)
50+
addressable (~> 2.8)
51+
algoliasearch (~> 1.0)
52+
concurrent-ruby (~> 1.1)
53+
fuzzy_match (~> 2.0.4)
54+
nap (~> 1.0)
55+
netrc (~> 0.11)
56+
public_suffix (~> 4.0)
57+
typhoeus (~> 1.0)
58+
cocoapods-deintegrate (1.0.5)
59+
cocoapods-downloader (2.1)
60+
cocoapods-plugins (1.0.0)
61+
nap
62+
cocoapods-search (1.0.1)
63+
cocoapods-trunk (1.6.0)
64+
nap (>= 0.8, < 2.0)
65+
netrc (~> 0.11)
66+
cocoapods-try (1.2.0)
67+
colored2 (3.1.2)
68+
concurrent-ruby (1.3.3)
69+
connection_pool (2.5.4)
70+
drb (2.2.3)
71+
escape (0.0.4)
72+
ethon (0.15.0)
73+
ffi (>= 1.15.0)
74+
ffi (1.17.2)
75+
ffi (1.17.2-aarch64-linux-gnu)
76+
ffi (1.17.2-aarch64-linux-musl)
77+
ffi (1.17.2-arm-linux-gnu)
78+
ffi (1.17.2-arm-linux-musl)
79+
ffi (1.17.2-arm64-darwin)
80+
ffi (1.17.2-x86-linux-gnu)
81+
ffi (1.17.2-x86-linux-musl)
82+
ffi (1.17.2-x86_64-darwin)
83+
ffi (1.17.2-x86_64-linux-gnu)
84+
ffi (1.17.2-x86_64-linux-musl)
85+
fourflusher (2.3.1)
86+
fuzzy_match (2.0.4)
87+
gh_inspector (1.1.3)
88+
httpclient (2.9.0)
89+
mutex_m
90+
i18n (1.14.7)
91+
concurrent-ruby (~> 1.0)
92+
json (2.15.1)
93+
logger (1.7.0)
94+
minitest (5.26.0)
95+
molinillo (0.8.0)
96+
mutex_m (0.3.0)
97+
nanaimo (0.4.0)
98+
nap (1.1.0)
99+
netrc (0.11.0)
100+
nkf (0.2.0)
101+
public_suffix (4.0.7)
102+
rexml (3.4.4)
103+
ruby-macho (2.5.1)
104+
securerandom (0.4.1)
105+
typhoeus (1.5.0)
106+
ethon (>= 0.9.0, < 0.16.0)
107+
tzinfo (2.0.6)
108+
concurrent-ruby (~> 1.0)
109+
xcodeproj (1.27.0)
110+
CFPropertyList (>= 2.3.3, < 4.0)
111+
atomos (~> 0.1.3)
112+
claide (>= 1.0.2, < 2.0)
113+
colored2 (~> 3.1)
114+
nanaimo (~> 0.4.0)
115+
rexml (>= 3.3.6, < 4.0)
116+
117+
PLATFORMS
118+
aarch64-linux-gnu
119+
aarch64-linux-musl
120+
arm-linux-gnu
121+
arm-linux-musl
122+
arm64-darwin
123+
ruby
124+
x86-linux-gnu
125+
x86-linux-musl
126+
x86_64-darwin
127+
x86_64-linux-gnu
128+
x86_64-linux-musl
129+
130+
DEPENDENCIES
131+
activesupport (>= 6.1.7.5, != 7.1.0)
132+
cocoapods (= 1.16.2)
133+
concurrent-ruby (< 1.3.4)
134+
xcodeproj (>= 1.27.0)
135+
136+
RUBY VERSION
137+
ruby 3.2.7p253
138+
139+
BUNDLED WITH
140+
2.7.2

ios/AppDelegate.h

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

ios/AppDelegate.m

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

ios/AppDelegate.swift

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import MendixNative
2+
3+
@UIApplicationMain
4+
class AppDelegate: ReactAppProvider, UNUserNotificationCenterDelegate {
5+
6+
var shouldOpenInLastApp = false
7+
var hasHandledLaunchAppWithOptions = false
8+
9+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
10+
11+
setUpProvider()
12+
super.application(application, didFinishLaunchingWithOptions: launchOptions)
13+
14+
clearKeychain()
15+
MendixAppDelegate.delegate = self
16+
UNUserNotificationCenter.current().delegate = self
17+
MendixAppDelegate.application(application, didFinishLaunchingWithOptions: launchOptions)
18+
setupUI()
19+
20+
changeRoot(to: UIViewController())
21+
22+
guard let url = Bundle.main.object(forInfoDictionaryKey: "Runtime url") as? String, !url.isEmpty else {
23+
showUnrecoverableDialog(
24+
title: "The runtime URL is missing",
25+
message: "Missing the 'Runtime url' configuration within the Info.plist file. The app will close."
26+
)
27+
return false
28+
}
29+
30+
if let bundleUrl = MendixAppDelegate.getJSBundleFile() {
31+
let runtimeUrl = AppUrl.forRuntime((url).replacingOccurrences(of: "\\", with: ""))
32+
33+
34+
let mendixApp = MendixApp(
35+
identifier: nil,
36+
bundleUrl: bundleUrl,
37+
runtimeUrl: runtimeUrl,
38+
warningsFilter: .none,
39+
isDeveloperApp: false,
40+
clearDataAtLaunch: false,
41+
splashScreenPresenter: SplashScreenPresenter(),
42+
reactLoading: nil,
43+
enableThreeFingerGestures: false
44+
)
45+
46+
ReactNative.shared.setup(mendixApp, launchOptions: launchOptions)
47+
ReactNative.shared.start()
48+
} else {
49+
showUnrecoverableDialog(
50+
title: "No Mendix bundle found",
51+
message: "Missing the Mendix app bundle. Make sure that the index.ios.bundle file is available in ios/NativeTemplate/Bundle folder. If building locally consult the documentation on how to generate a bundle from your project."
52+
)
53+
}
54+
55+
return true
56+
}
57+
58+
override func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
59+
return MendixAppDelegate.application(app, openURL: url, options: options)
60+
}
61+
62+
func getWarningFilterValue() -> WarningsFilter {
63+
return .none
64+
}
65+
66+
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
67+
MendixAppDelegate.userNotificationCenter(center, willPresentNotification: notification, withCompletionHandler: completionHandler)
68+
}
69+
70+
71+
// - (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
72+
// [MendixAppDelegate application:application didReceiveLocalNotification:notification];
73+
// }
74+
//
75+
// - (void) application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
76+
// fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
77+
// [MendixAppDelegate application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
78+
// }
79+
//
80+
// - (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
81+
// [MendixAppDelegate application:application didRegisterUserNotificationSettings:notificationSettings];
82+
// }
83+
//
84+
// - (void) userNotificationCenter:(UNUserNotificationCenter *)center
85+
// didReceiveNotificationResponse:(UNNotificationResponse *)response
86+
// withCompletionHandler:(void (^)(void))completionHandler {
87+
// [MendixAppDelegate userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
88+
// }
89+
}

0 commit comments

Comments
 (0)