From c6d5b68b086b595f91e8a586e98b8a70b2b118aa Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Tue, 22 May 2018 10:51:08 -0700 Subject: add macro to remove deprecated warning (#1295) --- Firebase/Messaging/FIRMessaging.m | 7 ++++++- Firebase/Messaging/FIRMessagingContextManagerService.m | 3 +++ Firebase/Messaging/FIRMessagingReceiver.m | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'Firebase/Messaging') diff --git a/Firebase/Messaging/FIRMessaging.m b/Firebase/Messaging/FIRMessaging.m index ec077c3..d5e0a01 100644 --- a/Firebase/Messaging/FIRMessaging.m +++ b/Firebase/Messaging/FIRMessaging.m @@ -411,13 +411,18 @@ NSString *const kFIRMessagingPlistAutoInitEnabled = // Similarly, |application:openURL:sourceApplication:annotation:| will also always be called, due // to the default swizzling done by FIRAAppDelegateProxy in Firebase Analytics } else if ([appDelegate respondsToSelector:openURLWithSourceApplicationSelector]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [appDelegate application:application openURL:url sourceApplication:FIRMessagingAppIdentifier() annotation:@{}]; - +#pragma clang diagnostic pop } else if ([appDelegate respondsToSelector:handleOpenURLSelector]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [appDelegate application:application handleOpenURL:url]; +#pragma clang diagnostic pop } } diff --git a/Firebase/Messaging/FIRMessagingContextManagerService.m b/Firebase/Messaging/FIRMessagingContextManagerService.m index 65f64ad..c7be606 100644 --- a/Firebase/Messaging/FIRMessagingContextManagerService.m +++ b/Firebase/Messaging/FIRMessagingContextManagerService.m @@ -129,7 +129,10 @@ typedef NS_ENUM(NSUInteger, FIRMessagingContextManagerMessageType) { + (void)scheduleLocalNotificationForMessage:(NSDictionary *)message atDate:(NSDate *)date { NSDictionary *apsDictionary = message; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" UILocalNotification *notification = [[UILocalNotification alloc] init]; +#pragma clang diagnostic pop // A great way to understand timezones and UILocalNotifications // http://stackoverflow.com/questions/18424569/understanding-uilocalnotification-timezone diff --git a/Firebase/Messaging/FIRMessagingReceiver.m b/Firebase/Messaging/FIRMessagingReceiver.m index 7a99c92..981dfb1 100644 --- a/Firebase/Messaging/FIRMessagingReceiver.m +++ b/Firebase/Messaging/FIRMessagingReceiver.m @@ -120,9 +120,11 @@ static int downstreamMessageID = 0; } else if ([appDelegate respondsToSelector:oldNotificationSelector]) { // Try the old remote notification callback +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [appDelegate application: [UIApplication sharedApplication] didReceiveRemoteNotification:message]; - +#pragma clang diagnostic pop } else { FIRMessagingLoggerError(kFIRMessagingMessageCodeReceiver005, @"None of the remote notification callbacks implemented by " -- cgit v1.2.3