From ebe57e995036045f0f5d0e633a05c7b35123da44 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Wed, 4 Nov 2020 12:53:31 +0100 Subject: [PATCH] Execute completion handler on main queue (#4947) (#4948) (cherry picked from commit 8d4b602ab8b7a88fe113423504fbc901f9d009c4) Co-authored-by: Miguel Alatzar --- .../RNNotificationEventHandler+HandleReplyAction.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m b/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m index e06975c75..e73b929cf 100644 --- a/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m +++ b/ios/Mattermost/RNNotificationEventHandler+HandleReplyAction.m @@ -102,7 +102,9 @@ NSString *const ReplyActionID = @"REPLY_ACTION"; [[UIApplication sharedApplication] setApplicationIconBadgeNumber:[notifications count]]; }]; - completionHandler(); + dispatch_async(dispatch_get_main_queue(), ^{ + completionHandler(); + }); } - (void) handleReplyFailure:(NSString *)channelId completionHandler:(void (^)(void))completionHandler { @@ -124,7 +126,9 @@ NSString *const ReplyActionID = @"REPLY_ACTION"; }; [notificationCenter sendLocalNotification:notification withId:id]; - completionHandler(); + dispatch_async(dispatch_get_main_queue(), ^{ + completionHandler(); + }); } #pragma mark - Method Swizzling