Execute completion handler on main queue (#4947)

This commit is contained in:
Miguel Alatzar 2020-11-04 04:38:37 -07:00 committed by GitHub
parent e57bcfdaba
commit 8d4b602ab8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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