Skip to content

Commit f016244

Browse files
YogendraShelkekarahanharunn
authored andcommitted
chore: clean ios notification template
1 parent ee76177 commit f016244

5 files changed

Lines changed: 1 addition & 106 deletions

File tree

ios/AppDelegate.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#import <Foundation/Foundation.h>
22
#import <UIKit/UIKit.h>
3-
#import <UserNotifications/UNUserNotificationCenter.h>
43

5-
@interface AppDelegate : UIResponder<UIApplicationDelegate, UNUserNotificationCenterDelegate>
4+
@interface AppDelegate : UIResponder<UIApplicationDelegate>
65

76
@property (nonatomic, strong) UIWindow *window;
87
@property BOOL shouldOpenInLastApp;

ios/AppDelegate.m

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ @implementation AppDelegate
1111

1212
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
1313
[self clearKeychain];
14-
MendixAppDelegate.delegate = self;
1514
[MendixAppDelegate application:application didFinishLaunchingWithOptions:launchOptions];
1615
[self setupUI];
1716

@@ -39,19 +38,6 @@ - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:
3938
return YES;
4039
}
4140

42-
- (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
43-
[MendixAppDelegate application:application didReceiveLocalNotification:notification];
44-
}
45-
46-
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
47-
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
48-
[MendixAppDelegate application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
49-
}
50-
51-
- (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
52-
[MendixAppDelegate application:application didRegisterUserNotificationSettings:notificationSettings];
53-
}
54-
5541
- (BOOL) application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
5642
return [MendixAppDelegate application:app openURL:url options:options];
5743
}
@@ -74,18 +60,6 @@ - (void) setupUI {
7460
}
7561
}
7662

77-
- (void) userNotificationCenter:(UNUserNotificationCenter *)center
78-
willPresentNotification:(UNNotification *)notification
79-
withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
80-
[MendixAppDelegate userNotificationCenter:center willPresentNotification:notification withCompletionHandler:completionHandler];
81-
}
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-
8963
- (void) clearKeychain {
9064
if ([NSUserDefaults.standardUserDefaults boolForKey:@"HAS_RUN_BEFORE"] == NO) {
9165
[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"HAS_RUN_BEFORE"];

ios/Dev/AppDelegate.m

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ @implementation AppDelegate
1111

1212
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
1313
[self clearKeychain];
14-
MendixAppDelegate.delegate = self;
1514
[MendixAppDelegate application:application didFinishLaunchingWithOptions:launchOptions];
1615
[self setupUI];
1716

@@ -25,19 +24,6 @@ - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:
2524
return YES;
2625
}
2726

28-
- (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
29-
[MendixAppDelegate application:application didReceiveLocalNotification:notification];
30-
}
31-
32-
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
33-
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
34-
[MendixAppDelegate application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
35-
}
36-
37-
- (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
38-
[MendixAppDelegate application:application didRegisterUserNotificationSettings:notificationSettings];
39-
}
40-
4127
- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
4228
BOOL isHandled = [MendixAppDelegate application:application openURL:url options:options];
4329

@@ -82,18 +68,6 @@ - (void) setupUI {
8268
}
8369
}
8470

85-
- (void) userNotificationCenter:(UNUserNotificationCenter *)center
86-
willPresentNotification:(UNNotification *)notification
87-
withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
88-
[MendixAppDelegate userNotificationCenter:center willPresentNotification:notification withCompletionHandler:completionHandler];
89-
}
90-
91-
- (void) userNotificationCenter:(UNUserNotificationCenter *)center
92-
didReceiveNotificationResponse:(UNNotificationResponse *)response
93-
withCompletionHandler:(void (^)(void))completionHandler {
94-
[MendixAppDelegate userNotificationCenter:center didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
95-
}
96-
9771
- (void) clearKeychain {
9872
if ([NSUserDefaults.standardUserDefaults boolForKey:@"HAS_RUN_BEFORE"] == NO) {
9973
[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"HAS_RUN_BEFORE"];

ios/MendixAppDelegate.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
11
#import <UIKit/UIKit.h>
2-
#import <UserNotifications/UserNotifications.h>
32

43
@interface MendixAppDelegate : NSObject
54

65
+ (void) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
76

8-
+ (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification;
9-
10-
+ (void) application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
11-
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler;
12-
13-
+ (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
14-
157
+ (BOOL) application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options;
168

179
+ (void) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
1810

19-
+ (void) userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler;
20-
21-
+ (void) userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler;
22-
23-
+ (UIResponder<UIApplicationDelegate, UNUserNotificationCenterDelegate> *_Nullable) delegate;
24-
25-
+ (void) setDelegate:(UIResponder<UIApplicationDelegate, UNUserNotificationCenterDelegate> *_Nonnull)value;
26-
2711
+ (NSURL *) getJSBundleFile;
2812
@end

ios/mendix_utils.rb

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ def generate_mendix_delegate
3737
imports = []
3838
hooks = {
3939
didFinishLaunchingWithOptions: [],
40-
didReceiveLocalNotification: [],
41-
didReceiveRemoteNotification: [],
42-
didRegisterUserNotificationSettings: [],
4340
openURL: [],
44-
willPresentNotification: [],
45-
didReceiveNotificationResponse: [],
4641
getJSBundleFile: [],
4742
}
4843

@@ -94,25 +89,10 @@ def mendix_app_delegate_template
9489
9590
@implementation MendixAppDelegate
9691
97-
static UIResponder<UIApplicationDelegate, UNUserNotificationCenterDelegate> *_Nullable delegate;
98-
9992
+ (void) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
10093
{{ didFinishLaunchingWithOptions }}
10194
}
10295
103-
+ (void) application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
104-
{{ didReceiveLocalNotification }}
105-
}
106-
107-
+ (void) application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
108-
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
109-
{{ didReceiveRemoteNotification }}
110-
}
111-
112-
+ (void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
113-
{{ didRegisterUserNotificationSettings }}
114-
}
115-
11696
+ (BOOL) application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
11797
{{ boolean_openURLWithOptions }}
11898
}
@@ -121,22 +101,6 @@ def mendix_app_delegate_template
121101
{{ openURL }}
122102
}
123103
124-
+ (void) userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
125-
{{ willPresentNotification }}
126-
}
127-
128-
+ (void) userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {
129-
{{ didReceiveNotificationResponse }}
130-
}
131-
132-
+ (UIResponder<UIApplicationDelegate, UNUserNotificationCenterDelegate> *_Nullable) delegate {
133-
return delegate;
134-
}
135-
136-
+ (void) setDelegate:(UIResponder<UIApplicationDelegate, UNUserNotificationCenterDelegate> *_Nonnull)value {
137-
delegate = value;
138-
}
139-
140104
+ (NSURL *) getJSBundleFile {
141105
{{ getJSBundleFile }}
142106
return [ReactNative.instance getJSBundleFile];

0 commit comments

Comments
 (0)