diff options
author | Chen Liang <chliang@google.com> | 2018-06-19 14:08:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 14:08:53 -0700 |
commit | 69ccd6d8b18b833acfd47ce251f05e94000e6ff5 (patch) | |
tree | c6f9f3ac6632940022cbd19c17f34fe0b8390536 /Firebase/Messaging/FIRMessagingPubSub.m | |
parent | fb9482c303a3f53c2f16eb41a8614f2d4302a9e3 (diff) |
Corrected the deprecation warning when subscribing to or unsubscribing from a topic (#1425)
Diffstat (limited to 'Firebase/Messaging/FIRMessagingPubSub.m')
-rw-r--r-- | Firebase/Messaging/FIRMessagingPubSub.m | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Firebase/Messaging/FIRMessagingPubSub.m b/Firebase/Messaging/FIRMessagingPubSub.m index 09491b4..3f954e8 100644 --- a/Firebase/Messaging/FIRMessagingPubSub.m +++ b/Firebase/Messaging/FIRMessagingPubSub.m @@ -231,6 +231,14 @@ static NSString *const kTopicRegexPattern = @"/topics/([a-zA-Z0-9-_.~%]+)"; } } ++ (NSString *)removePrefixFromTopic:(NSString *)topic { + if ([self hasTopicsPrefix:topic]) { + return [topic substringFromIndex:kTopicsPrefix.length]; + } else { + return [topic copy]; + } +} + + (BOOL)hasTopicsPrefix:(NSString *)topic { return [topic hasPrefix:kTopicsPrefix]; } |