From 163eeeecb75f24f155becaa76a95574c266d8a4f Mon Sep 17 00:00:00 2001 From: Ryan Wilson Date: Tue, 12 Dec 2017 19:18:24 -0500 Subject: Revert changes introduced in #546 to fix build breakage. (#562) --- Firebase/Messaging/FIRMessaging.m | 5 +++-- Firebase/Messaging/FIRMessagingContextManagerService.m | 2 +- Firebase/Messaging/FIRMessagingRmq2PersistentStore.m | 10 +++------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Firebase/Messaging/FIRMessaging.m b/Firebase/Messaging/FIRMessaging.m index 23feee9..782b779 100644 --- a/Firebase/Messaging/FIRMessaging.m +++ b/Firebase/Messaging/FIRMessaging.m @@ -384,6 +384,7 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification = id appDelegate = application.delegate; SEL continueUserActivitySelector = @selector(application:continueUserActivity:restorationHandler:); + SEL openURLWithOptionsSelector = @selector(application:openURL:options:); SEL openURLWithSourceApplicationSelector = @selector(application:openURL:sourceApplication:annotation:); SEL handleOpenURLSelector = @selector(application:handleOpenURL:); @@ -402,7 +403,7 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification = // Do nothing, as we don't support the app calling this block }]; - } else if (@available(iOS 9.0, *)) { + } else if ([appDelegate respondsToSelector:openURLWithOptionsSelector]) { [appDelegate application:application openURL:url options:@{}]; // Similarly, |application:openURL:sourceApplication:annotation:| will also always be called, due @@ -726,7 +727,7 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification = - (void)receiver:(FIRMessagingReceiver *)receiver receivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage { - if (@available(iOS 10.0, *)) { + if ([self.delegate respondsToSelector:@selector(messaging:didReceiveMessage:)]) { [self.delegate messaging:self didReceiveMessage:remoteMessage]; } else if ([self.delegate respondsToSelector:@selector(applicationReceivedRemoteMessage:)]) { #pragma clang diagnostic push diff --git a/Firebase/Messaging/FIRMessagingContextManagerService.m b/Firebase/Messaging/FIRMessagingContextManagerService.m index dffd6ae..232587f 100644 --- a/Firebase/Messaging/FIRMessagingContextManagerService.m +++ b/Firebase/Messaging/FIRMessagingContextManagerService.m @@ -143,7 +143,7 @@ typedef NS_ENUM(NSUInteger, FIRMessagingContextManagerMessageType) { } if ([apsDictionary[kFIRMessagingContextManagerTitleKey] length]) { // |alertTitle| is iOS 8.2+, so check if we can set it - if (@available(iOS 8.2, *)) { + if ([notification respondsToSelector:@selector(setAlertTitle:)]) { notification.alertTitle = apsDictionary[kFIRMessagingContextManagerTitleKey]; } } diff --git a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m index e468333..189f366 100644 --- a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m +++ b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m @@ -104,13 +104,9 @@ typedef void(^FCMOutgoingRmqMessagesTableHandler)(int64_t rmqId, int8_t tag, NSD // Utility to create an NSString from a sqlite3 result code NSString * _Nonnull FIRMessagingStringFromSQLiteResult(int result) { - const char *errorStr; - if (@available(iOS 8.2, *)) { - errorStr = sqlite3_errstr(result); - } else { - errorStr = "pre iOS 8.2"; - } - return [NSString stringWithFormat:@"%d - %s", result, errorStr]; + const char *errorStr = sqlite3_errstr(result); + NSString *errorString = [NSString stringWithFormat:@"%d - %s", result, errorStr]; + return errorString; } @interface FIRMessagingRmq2PersistentStore () { -- cgit v1.2.3