Skip to content

Commit 7fffe69

Browse files
Ingrid Wangfacebook-github-bot
Ingrid Wang
authored andcommitted
Delete deprecated didReceiveLocal/RemoteNotification (#43117)
Summary: Pull Request resolved: #43117 Changelog: [iOS][Breaking] Deleting deprecated didReceiveLocalNotification & didReceiveRemoteNotification callbacks on RCTPushNotificationManager Reviewed By: philIip Differential Revision: D52883365 fbshipit-source-id: b7136ecaf73263b8f8b633c8861a673868ac252e
1 parent 410e3b5 commit 7fffe69

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,4 @@ typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result);
4545
*/
4646
+ (void)setInitialNotification:(UNNotification *)notification;
4747

48-
/** DEPRECATED. Use didReceiveNotification instead. */
49-
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification RCT_DEPRECATED;
50-
/** DEPRECATED. Use didReceiveNotification instead. */
51-
+ (void)didReceiveRemoteNotification:(NSDictionary *)notification RCT_DEPRECATED;
52-
5348
@end

packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,6 @@ @implementation RCTConvert (UIBackgroundFetchResult)
9797

9898
@implementation RCTPushNotificationManager
9999

100-
/** DEPRECATED. UILocalNotification was deprecated in iOS 10. Please don't add new callsites. */
101-
static NSDictionary *RCTFormatLocalNotification(UILocalNotification *notification)
102-
{
103-
NSMutableDictionary *formattedLocalNotification = [NSMutableDictionary dictionary];
104-
if (notification.fireDate) {
105-
NSDateFormatter *formatter = [NSDateFormatter new];
106-
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"];
107-
NSString *fireDateString = [formatter stringFromDate:notification.fireDate];
108-
formattedLocalNotification[@"fireDate"] = fireDateString;
109-
}
110-
formattedLocalNotification[@"alertAction"] = RCTNullIfNil(notification.alertAction);
111-
formattedLocalNotification[@"alertBody"] = RCTNullIfNil(notification.alertBody);
112-
formattedLocalNotification[@"applicationIconBadgeNumber"] = @(notification.applicationIconBadgeNumber);
113-
formattedLocalNotification[@"category"] = RCTNullIfNil(notification.category);
114-
formattedLocalNotification[@"soundName"] = RCTNullIfNil(notification.soundName);
115-
formattedLocalNotification[@"userInfo"] = RCTNullIfNil(RCTJSONClean(notification.userInfo));
116-
formattedLocalNotification[@"remote"] = @NO;
117-
return formattedLocalNotification;
118-
}
119-
120100
/** For delivered notifications */
121101
static NSDictionary<NSString *, id> *RCTFormatUNNotification(UNNotification *notification)
122102
{
@@ -267,23 +247,6 @@ + (void)setInitialNotification:(UNNotification *)notification
267247
kInitialNotification = notification;
268248
}
269249

270-
// Deprecated
271-
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification
272-
{
273-
[[NSNotificationCenter defaultCenter] postNotificationName:kLocalNotificationReceived
274-
object:self
275-
userInfo:RCTFormatLocalNotification(notification)];
276-
}
277-
278-
// Deprecated
279-
+ (void)didReceiveRemoteNotification:(NSDictionary *)notification
280-
{
281-
NSDictionary *userInfo = @{@"notification" : notification};
282-
[[NSNotificationCenter defaultCenter] postNotificationName:RCTRemoteNotificationReceived
283-
object:self
284-
userInfo:userInfo];
285-
}
286-
287250
- (void)invalidate
288251
{
289252
[super invalidate];

0 commit comments

Comments
 (0)