diff options
Diffstat (limited to 'Firebase/Messaging')
-rw-r--r-- | Firebase/Messaging/CHANGELOG.md | 3 | ||||
-rw-r--r-- | Firebase/Messaging/FIRMMessageCode.h | 1 | ||||
-rw-r--r-- | Firebase/Messaging/FIRMessaging.m | 13 | ||||
-rw-r--r-- | Firebase/Messaging/FIRMessagingContextManagerService.m | 4 |
4 files changed, 17 insertions, 4 deletions
diff --git a/Firebase/Messaging/CHANGELOG.md b/Firebase/Messaging/CHANGELOG.md index 78dc8d9..22b5031 100644 --- a/Firebase/Messaging/CHANGELOG.md +++ b/Firebase/Messaging/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2018-05-29 -- v3.0.1 +- Clean up a few deprecation warnings. + # 2018-05-08 -- v3.0.0 - Remove deprecated delegate property `remoteMessageDelegate`, please use `delegate` instead. - Remove deprecated method `messaging:didRefreshRegistrationToken:` defined in FIRMessagingDelegate protocol, please use `messaging:didReceiveRegistrationToken:` instead. diff --git a/Firebase/Messaging/FIRMMessageCode.h b/Firebase/Messaging/FIRMMessageCode.h index c1b8ffb..0d7e027 100644 --- a/Firebase/Messaging/FIRMMessageCode.h +++ b/Firebase/Messaging/FIRMMessageCode.h @@ -45,6 +45,7 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageCode) { kFIRMessagingMessageCodeSenderIDNotSuppliedForTokenDelete = 2021, // I-FCM002021 kFIRMessagingMessageCodeAPNSTokenNotAvailableDuringTokenFetch = 2022, // I-FCM002022 kFIRMessagingMessageCodeTokenDelegateMethodsNotImplemented = 2023, // I-FCM002023 + kFIRMessagingMessageCodeTopicFormatIsDeprecated = 2024, // FIRMessagingClient.m kFIRMessagingMessageCodeClient000 = 4000, // I-FCM004000 kFIRMessagingMessageCodeClient001 = 4001, // I-FCM004001 diff --git a/Firebase/Messaging/FIRMessaging.m b/Firebase/Messaging/FIRMessaging.m index 3c1c730..3c4d999 100644 --- a/Firebase/Messaging/FIRMessaging.m +++ b/Firebase/Messaging/FIRMessaging.m @@ -421,10 +421,7 @@ NSString *const kFIRMessagingPlistAutoInitEnabled = 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 } @@ -700,6 +697,11 @@ NSString *const kFIRMessagingPlistAutoInitEnabled = completion:(nullable FIRMessagingTopicOperationCompletion)completion { if (self.defaultFcmToken.length && topic.length) { NSString *normalizeTopic = [[self class ] normalizeTopic:topic]; + if ([FIRMessagingPubSub hasTopicsPrefix:topic]) { + FIRMessagingLoggerWarn(kFIRMessagingMessageCodeTopicFormatIsDeprecated, + @"Format '%@' is deprecated. Only '%@' should be used in " + @"subscribeToTopic.", topic, normalizeTopic); + } if (normalizeTopic.length) { [self.pubsub subscribeToTopic:normalizeTopic handler:completion]; } else { @@ -721,6 +723,11 @@ NSString *const kFIRMessagingPlistAutoInitEnabled = completion:(nullable FIRMessagingTopicOperationCompletion)completion { if (self.defaultFcmToken.length && topic.length) { NSString *normalizeTopic = [[self class] normalizeTopic:topic]; + if ([FIRMessagingPubSub hasTopicsPrefix:topic]) { + FIRMessagingLoggerWarn(kFIRMessagingMessageCodeTopicFormatIsDeprecated, + @"Format '%@' is deprecated. Only '%@' should be used in " + @"unsubscribeFromTopic.", topic, normalizeTopic); + } if (normalizeTopic.length) { [self.pubsub unsubscribeFromTopic:normalizeTopic handler:completion]; } else { diff --git a/Firebase/Messaging/FIRMessagingContextManagerService.m b/Firebase/Messaging/FIRMessagingContextManagerService.m index c7be606..f79e79c 100644 --- a/Firebase/Messaging/FIRMessagingContextManagerService.m +++ b/Firebase/Messaging/FIRMessagingContextManagerService.m @@ -172,8 +172,10 @@ typedef NS_ENUM(NSUInteger, FIRMessagingContextManagerMessageType) { if (userInfo.count) { notification.userInfo = userInfo; } - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [[UIApplication sharedApplication] scheduleLocalNotification:notification]; +#pragma clang diagnostic pop } + (NSDictionary *)parseDataFromMessage:(NSDictionary *)message { |