@@ -11,21 +11,75 @@ const HANDLER_FILE = resolve(
1111 "node_modules/@capacitor/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsHandler.swift" ,
1212) ;
1313
14- const REPLACEMENTS : ReadonlyArray < [ RegExp , string ] > = [
14+ const REPLACEMENTS : ReadonlyArray < [ string , string ] > = [
1515 [
16- / g u a r d l e t n o t i f i c a t i o n s = c a l l \. g e t A r r a y \( " n o t i f i c a t i o n s " , J S O b j e c t \. s e l f \) e l s e \{ / g,
17- 'guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }) else {' ,
16+ [
17+ ' guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }) else {\n' ,
18+ ' call.reject("Must provide notifications array as notifications option")\n' ,
19+ " return\n" ,
20+ " }\n" ,
21+ ] . join ( "" ) ,
22+ [
23+ ' guard call.getValue("notifications") != nil else {\n' ,
24+ ' call.reject("Must provide notifications array as notifications option")\n' ,
25+ " return\n" ,
26+ " }\n" ,
27+ ' let notifications = call.getArray("notifications", []).compactMap({ $0 as? JSObject })\n' ,
28+ ] . join ( "" ) ,
29+ ] ,
30+ [
31+ [
32+ ' guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }), notifications.count > 0 else {\n' ,
33+ ' call.reject("Must supply notifications to cancel")\n' ,
34+ " return\n" ,
35+ " }\n" ,
36+ ] . join ( "" ) ,
37+ [
38+ ' guard call.getValue("notifications") != nil else {\n' ,
39+ ' call.reject("Must supply notifications to cancel")\n' ,
40+ " return\n" ,
41+ " }\n" ,
42+ ' let notifications = call.getArray("notifications", []).compactMap({ $0 as? JSObject })\n' ,
43+ " guard notifications.count > 0 else {\n" ,
44+ ' call.reject("Must supply notifications to cancel")\n' ,
45+ " return\n" ,
46+ " }\n" ,
47+ ] . join ( "" ) ,
1848 ] ,
1949 [
20- / g u a r d l e t n o t i f i c a t i o n s = c a l l \. g e t A r r a y \( " n o t i f i c a t i o n s " , J S O b j e c t \. s e l f \) , n o t i f i c a t i o n s \. c o u n t > 0 e l s e \{ / g,
21- 'guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }), notifications.count > 0 else {' ,
50+ [
51+ ' guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }), notifications.count > 0 else {\n' ,
52+ ' call.reject("Must supply notifications to remove")\n' ,
53+ " return\n" ,
54+ " }\n" ,
55+ ] . join ( "" ) ,
56+ [
57+ ' guard call.getValue("notifications") != nil else {\n' ,
58+ ' call.reject("Must supply notifications to remove")\n' ,
59+ " return\n" ,
60+ " }\n" ,
61+ ' let notifications = call.getArray("notifications", []).compactMap({ $0 as? JSObject })\n' ,
62+ " guard notifications.count > 0 else {\n" ,
63+ ' call.reject("Must supply notifications to remove")\n' ,
64+ " return\n" ,
65+ " }\n" ,
66+ ] . join ( "" ) ,
2267 ] ,
2368 [
24- / g u a r d l e t t y p e s = c a l l \. g e t A r r a y \( " t y p e s " , J S O b j e c t \. s e l f \) e l s e \{ / g,
25- 'guard let types = call.getArray("types")?.compactMap({ $0 as? JSObject }) else {' ,
69+ [
70+ ' guard let types = call.getArray("types")?.compactMap({ $0 as? JSObject }) else {\n' ,
71+ " return\n" ,
72+ " }\n" ,
73+ ] . join ( "" ) ,
74+ [
75+ ' guard call.getValue("types") != nil else {\n' ,
76+ " return\n" ,
77+ " }\n" ,
78+ ' let types = call.getArray("types", []).compactMap({ $0 as? JSObject })\n' ,
79+ ] . join ( "" ) ,
2680 ] ,
2781 [
28- / r e t u r n b r i d g e \? \ .l o c a l U R L \ (f r o m W e b U R L : w e b U R L \) / g ,
82+ " return bridge? .localURL(fromWebURL: webURL)" ,
2983 [
3084 " switch webURL.scheme {" ,
3185 ' case "res":' ,
0 commit comments