-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAppDelegate.swift
More file actions
55 lines (47 loc) · 1.8 KB
/
Copy pathAppDelegate.swift
File metadata and controls
55 lines (47 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
import MendixNative
@main
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
self.moduleName = "App"
self.dependencyProvider = RCTAppDependencyProvider()
self.initialProps = [:]
super.application(application, didFinishLaunchingWithOptions: launchOptions)
//Start - For MendixApplication compatibility only, not part of React Native template
SessionCookieStore.restore()
MxConfiguration.update(from:
MendixApp.init(
identifier: nil,
bundleUrl: bundleURL()!,
runtimeUrl: URL(string: "http://localhost:8081")!,
warningsFilter: .none,
isDeveloperApp: false,
clearDataAtLaunch: false,
splashScreenPresenter: nil,
reactLoading: nil,
enableThreeFingerGestures: false
)
)
//End - For MendixApplication compatibility only, not part of React Native template
return true
}
override func applicationDidEnterBackground(_ application: UIApplication) {
SessionCookieStore.persist()
}
override func applicationWillTerminate(_ application: UIApplication) {
SessionCookieStore.persist()
}
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}
override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}