Skip to content

Commit b07da32

Browse files
addressed review comments
1 parent fe5ce1d commit b07da32

3 files changed

Lines changed: 11 additions & 54 deletions

File tree

ios/AppDelegate.swift

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ class AppDelegate: ReactAppProvider, UNUserNotificationCenterDelegate {
88

99
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
1010

11-
setUpProvider()
12-
super.application(application, didFinishLaunchingWithOptions: launchOptions)
13-
14-
clearKeychain()
11+
setupApp(application: application, launchOptions: launchOptions)
1512
MendixAppDelegate.delegate = self
1613
UNUserNotificationCenter.current().delegate = self
1714
MendixAppDelegate.application(application, didFinishLaunchingWithOptions: launchOptions)
18-
setupUI()
1915

2016
changeRoot(to: UIViewController())
2117

@@ -28,8 +24,8 @@ class AppDelegate: ReactAppProvider, UNUserNotificationCenterDelegate {
2824
}
2925

3026
if let bundleUrl = MendixAppDelegate.getJSBundleFile() {
31-
let runtimeUrl = AppUrl.forRuntime((url).replacingOccurrences(of: "\\", with: ""))
3227

28+
let runtimeUrl = AppUrl.forRuntime((url).replacingOccurrences(of: "\\", with: ""))
3329

3430
let mendixApp = MendixApp(
3531
identifier: nil,
@@ -66,24 +62,4 @@ class AppDelegate: ReactAppProvider, UNUserNotificationCenterDelegate {
6662
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
6763
MendixAppDelegate.userNotificationCenter(center, willPresentNotification: notification, withCompletionHandler: completionHandler)
6864
}
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-
// }
8965
}

ios/Dev/AppDelegate.swift

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ class AppDelegate: ReactAppProvider, UNUserNotificationCenterDelegate {
88
var hasHandledLaunchAppWithOptions = false
99

1010
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
11-
12-
setUpProvider()
13-
super.application(application, didFinishLaunchingWithOptions: launchOptions)
14-
clearKeychain()
11+
setupApp(application: application, launchOptions: launchOptions)
1512
MendixAppDelegate.delegate = self
1613
UNUserNotificationCenter.current().delegate = self
1714
MendixAppDelegate.application(application, didFinishLaunchingWithOptions: launchOptions)
18-
setupUI()
1915

2016
IQKeyboardManager.shared().isEnabled = false
2117

@@ -72,30 +68,8 @@ class AppDelegate: ReactAppProvider, UNUserNotificationCenterDelegate {
7268
)
7369

7470
ReactNative.shared.setup(mxApp, launchOptions: launchOptions as? [AnyHashable : Any])
75-
76-
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
77-
ReactNative.shared.start()
78-
}
71+
ReactNative.shared.start()
7972

8073
return handled
8174
}
82-
//
83-
// - (void) userNotificationCenter:(UNUserNotificationCenter *)center
84-
// didReceiveNotificationResponse:(UNNotificationResponse *)response
85-
// withCompletionHandler:(void (^)(void))completionHandler {
86-
// [MendixAppDelegate userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
87-
// }
88-
//
89-
// - (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
90-
// [MendixAppDelegate application:application didReceiveLocalNotification:notification];
91-
// }
92-
//
93-
// - (void) application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
94-
// fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
95-
// [MendixAppDelegate application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
96-
// }
97-
//
98-
// - (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
99-
// [MendixAppDelegate application:application didRegisterUserNotificationSettings:notificationSettings];
100-
// }
10175
}

ios/Extensions/AppDelegate+Extension.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ extension AppDelegate {
2222
}))
2323
window.rootViewController?.present(controller, animated: true, completion: nil)
2424
}
25+
26+
func setupApp(application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) {
27+
setUpProvider()
28+
super.application(application, didFinishLaunchingWithOptions: launchOptions)
29+
clearKeychain()
30+
setupUI()
31+
}
2532
}

0 commit comments

Comments
 (0)