aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Messaging/FIRMessaging.m
diff options
context:
space:
mode:
authorGravatar Morgan Chen <morganchen12@gmail.com>2018-05-23 11:37:10 -0700
committerGravatar GitHub <noreply@github.com>2018-05-23 11:37:10 -0700
commit7ecd3d1266539001666f802ee05f9ffc3af6d028 (patch)
treed91897c12ca81580d44e73999da105248e05153e /Firebase/Messaging/FIRMessaging.m
parent6e95680ba80166a967abc63d0e79a5ffcc1525f5 (diff)
parente345eb39dec29d6163763170ff84a77da3abce2b (diff)
Merge pull request #1312 from alexames/master
Warn when topic format is incorrect.
Diffstat (limited to 'Firebase/Messaging/FIRMessaging.m')
-rw-r--r--Firebase/Messaging/FIRMessaging.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/Firebase/Messaging/FIRMessaging.m b/Firebase/Messaging/FIRMessaging.m
index cb5559f..ec73474 100644
--- a/Firebase/Messaging/FIRMessaging.m
+++ b/Firebase/Messaging/FIRMessaging.m
@@ -693,6 +693,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(kFIRMessagingMessageCodeMessaging006,
+ @"Format '%@' is deprecated. Only '%@' should be used in "
+ @"subscribeToTopic.", topic, normalizeTopic);
+ }
if (normalizeTopic.length) {
[self.pubsub subscribeToTopic:normalizeTopic handler:completion];
} else {
@@ -714,6 +719,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(kFIRMessagingMessageCodeMessaging007,
+ @"Format '%@' is deprecated. Only '%@' should be used in "
+ @"unsubscribeFromTopic.", topic, normalizeTopic);
+ }
if (normalizeTopic.length) {
[self.pubsub unsubscribeFromTopic:normalizeTopic handler:completion];
} else {