From ef6b641802e07592e59cf16b3a033da2cb926214 Mon Sep 17 00:00:00 2001 From: tmoldovan8x8 <62697631+tmoldovan8x8@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:03:25 +0200 Subject: [PATCH] bugfix(ios) changes the participantInfo completion handler reference to strong. When the method was called from Swift they were collected before calling them. --- ios/sdk/src/ExternalAPI.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/sdk/src/ExternalAPI.m b/ios/sdk/src/ExternalAPI.m index 9ef20fc268..4dbc8e9796 100644 --- a/ios/sdk/src/ExternalAPI.m +++ b/ios/sdk/src/ExternalAPI.m @@ -30,7 +30,7 @@ static NSMapTable *participantIn __attribute__((constructor)) static void initializeViewsMap() { - participantInfoCompletionHandlers = [NSMapTable strongToWeakObjectsMapTable]; + participantInfoCompletionHandlers = [NSMapTable strongToStrongObjectsMapTable]; } RCT_EXPORT_MODULE(); @@ -160,7 +160,7 @@ RCT_EXPORT_METHOD(sendEvent:(NSString *)name NSString *completionHandlerId = [[NSUUID UUID] UUIDString]; NSDictionary *data = @{ @"requestId": completionHandlerId}; - [participantInfoCompletionHandlers setObject:completionHandler forKey:completionHandlerId]; + [participantInfoCompletionHandlers setObject:[completionHandler copy] forKey:completionHandlerId]; [self sendEventWithName:retrieveParticipantsInfoAction body:data]; }