From c6f73f7218360b364e1feb85489c58d837b575fc Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Wed, 28 Feb 2018 10:35:25 -0800 Subject: Fix the issue completion handler is not triggered in subscribeToTopic. (#867) * fix the issue that handler not get triggered --- Firebase/Messaging/FIRMessagingPendingTopicsList.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Firebase/Messaging') diff --git a/Firebase/Messaging/FIRMessagingPendingTopicsList.m b/Firebase/Messaging/FIRMessagingPendingTopicsList.m index 792090e..8bab770 100644 --- a/Firebase/Messaging/FIRMessagingPendingTopicsList.m +++ b/Firebase/Messaging/FIRMessagingPendingTopicsList.m @@ -160,9 +160,10 @@ NSString *const kPendingTopicsTimestampEncodingKey = @"ts"; if (completion) { NSMutableArray *handlers = lastBatch.topicHandlers[topic]; if (!handlers) { - handlers = [NSMutableArray arrayWithCapacity:1]; + handlers = [[NSMutableArray alloc] init]; } [handlers addObject:completion]; + lastBatch.topicHandlers[topic] = handlers; } if (!self.currentBatch) { self.currentBatch = lastBatch; -- cgit v1.2.3