aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase
diff options
context:
space:
mode:
authorGravatar Paul Beusterien <paulbeusterien@google.com>2017-12-08 10:12:15 -0800
committerGravatar GitHub <noreply@github.com>2017-12-08 10:12:15 -0800
commit49a7ed7fc9befb753a920ead5c31b80d3f7338c3 (patch)
treefe7653e7bdff6d39c09f63b291e610a3ce72b05f /Firebase
parent3418244cd52ca4e4131ca106bf66cba754ec886c (diff)
Fix FCM build warning introduced in Xcode 9 (#546)
Diffstat (limited to 'Firebase')
-rw-r--r--Firebase/Messaging/FIRMessaging.m5
-rw-r--r--Firebase/Messaging/FIRMessagingContextManagerService.m2
-rw-r--r--Firebase/Messaging/FIRMessagingRmq2PersistentStore.m10
3 files changed, 10 insertions, 7 deletions
diff --git a/Firebase/Messaging/FIRMessaging.m b/Firebase/Messaging/FIRMessaging.m
index 782b779..23feee9 100644
--- a/Firebase/Messaging/FIRMessaging.m
+++ b/Firebase/Messaging/FIRMessaging.m
@@ -384,7 +384,6 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification =
id<UIApplicationDelegate> 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:);
@@ -403,7 +402,7 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification =
// Do nothing, as we don't support the app calling this block
}];
- } else if ([appDelegate respondsToSelector:openURLWithOptionsSelector]) {
+ } else if (@available(iOS 9.0, *)) {
[appDelegate application:application openURL:url options:@{}];
// Similarly, |application:openURL:sourceApplication:annotation:| will also always be called, due
@@ -727,7 +726,7 @@ NSString * const FIRMessagingRegistrationTokenRefreshedNotification =
- (void)receiver:(FIRMessagingReceiver *)receiver
receivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {
- if ([self.delegate respondsToSelector:@selector(messaging:didReceiveMessage:)]) {
+ if (@available(iOS 10.0, *)) {
[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 1c9f653..dffd6ae 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 ([notification respondsToSelector:@selector(setAlertTitle:)]) {
+ if (@available(iOS 8.2, *)) {
notification.alertTitle = apsDictionary[kFIRMessagingContextManagerTitleKey];
}
}
diff --git a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
index a85298c..e468333 100644
--- a/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
+++ b/Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
@@ -104,9 +104,13 @@ 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 = sqlite3_errstr(result);
- NSString *errorString = [NSString stringWithFormat:@"%d - %s", result, errorStr];
- return errorString;
+ 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];
}
@interface FIRMessagingRmq2PersistentStore () {