Skip to content

Commit 53a3ecc

Browse files
authored
chore: refactor RCTConvert (#240)
1 parent fce15a6 commit 53a3ecc

File tree

7 files changed

+377
-288
lines changed

7 files changed

+377
-288
lines changed

example/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ export const App = (): React.Node => {
239239
`Alert title: ${notification.getTitle()},
240240
Alert subtitle: ${notification.getSubtitle()},
241241
Alert message: ${notification.getMessage()},
242+
Badge: ${notification.getBadgeCount()},
243+
Sound: ${notification.getSound()},
242244
Thread Id: ${notification.getThreadID()},
243245
Action Id: ${notification.getActionIdentifier()},
244246
User Text: ${notification.getUserText()},

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ PODS:
292292
- React-cxxreact (= 0.62.2)
293293
- React-jsi (= 0.62.2)
294294
- ReactCommon/callinvoker (= 0.62.2)
295-
- RNCPushNotificationIOS (1.7.3):
295+
- RNCPushNotificationIOS (1.7.4):
296296
- React-Core
297297
- Yoga (1.14.0)
298298
- YogaKit (1.18.1):
@@ -453,7 +453,7 @@ SPEC CHECKSUMS:
453453
React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
454454
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
455455
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
456-
RNCPushNotificationIOS: edeeea93b7210d2f918fc0e46e1a2a189b5fdacc
456+
RNCPushNotificationIOS: 8fdfa22a6ecb1dfcc2316939f73335bfd6470044
457457
Yoga: 3ebccbdd559724312790e7742142d062476b698e
458458
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
459459

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@
590590
baseConfigurationReference = 88185B6F69F96250716C8945 /* Pods-example-exampleTests.debug.xcconfig */;
591591
buildSettings = {
592592
BUNDLE_LOADER = "$(TEST_HOST)";
593+
EXCLUDED_ARCHS = arm64;
593594
GCC_PREPROCESSOR_DEFINITIONS = (
594595
"DEBUG=1",
595596
"$(inherited)",
@@ -614,6 +615,7 @@
614615
buildSettings = {
615616
BUNDLE_LOADER = "$(TEST_HOST)";
616617
COPY_PHASE_STRIP = NO;
618+
EXCLUDED_ARCHS = arm64;
617619
INFOPLIST_FILE = exampleTests/Info.plist;
618620
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
619621
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -636,6 +638,7 @@
636638
CLANG_ENABLE_MODULES = YES;
637639
CURRENT_PROJECT_VERSION = 1;
638640
ENABLE_BITCODE = NO;
641+
EXCLUDED_ARCHS = arm64;
639642
GCC_PREPROCESSOR_DEFINITIONS = (
640643
"$(inherited)",
641644
"FB_SONARKIT_ENABLED=1",
@@ -662,6 +665,7 @@
662665
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
663666
CLANG_ENABLE_MODULES = YES;
664667
CURRENT_PROJECT_VERSION = 1;
668+
EXCLUDED_ARCHS = arm64;
665669
INFOPLIST_FILE = example/Info.plist;
666670
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
667671
OTHER_LDFLAGS = (

ios/RCTConvert+Notification.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// RCTConvert+Notification.h
3+
// Pods
4+
//
5+
// Created by Jesse Katsumata on 2020/11/25.
6+
//
7+
8+
#import <React/RCTConvert.h>
9+
#import <React/RCTUtils.h>
10+
#import <UserNotifications/UserNotifications.h>
11+
12+
@interface RCTConvert (NSCalendarUnit)
13+
+ (NSCalendarUnit)NSCalendarUnit:(id)json;
14+
@end
15+
16+
/**
17+
* Type deprecated in iOS 10.0
18+
* TODO: This method will be removed in the next major version
19+
*/
20+
@interface RCTConvert (UILocalNotification)
21+
+ (UILocalNotification *)UILocalNotification:(id)json;
22+
+ (NSDictionary *)RCTFormatLocalNotification:(UILocalNotification *)notification;
23+
@end
24+
25+
@interface RCTConvert (UNNotificationRequest)
26+
+ (UNNotificationRequest *)UNNotificationRequest:(id)json;
27+
+ (NSDictionary *)RCTFormatUNNotificationRequest:(UNNotificationRequest *)request;
28+
@end
29+
30+
@interface RCTConvert (UNNotificationAction)
31+
+ (UNNotificationAction *)UNNotificationAction:(id)json;
32+
@end
33+
34+
@interface RCTConvert (UNNotificationActionOptions)
35+
+ (UNNotificationActionOptions *)UNNotificationActionOptions:(id)json;
36+
@end
37+
38+
@interface RCTConvert (UNNotificationCategory)
39+
+ (UNNotificationCategory *)UNNotificationCategory:(id)json;
40+
@end
41+
42+
43+
@interface RCTConvert (UNNotificationResponse)
44+
+ (NSDictionary *)RCTFormatUNNotificationResponse:(UNNotificationResponse *)response;
45+
@end
46+
47+
@interface RCTConvert (UNNotification)
48+
+ (NSDictionary *)RCTFormatUNNotification:(UNNotification *)notification;
49+
@end
50+
51+

0 commit comments

Comments
 (0)