From 9629251e30b2ab3dbbc19fe64e57f2ab16691b14 Mon Sep 17 00:00:00 2001 From: Felix Holmgren Date: Wed, 25 Mar 2020 13:58:39 +0100 Subject: [PATCH] Loop through all attachments, no breaking * If there is a URL or an image, we want to find it even if we've already found some plain text * Specifically, Firefox and Brave put the title earlier in the list than the URL, so the URL is never found if we break out of the iteration --- ios/ReactNativeShareExtension.m | 3 --- 1 file changed, 3 deletions(-) diff --git a/ios/ReactNativeShareExtension.m b/ios/ReactNativeShareExtension.m index ddf1e692..01fe8dec 100644 --- a/ios/ReactNativeShareExtension.m +++ b/ios/ReactNativeShareExtension.m @@ -79,13 +79,10 @@ - (void)extractDataFromContext:(NSExtensionContext *)context withCallback:(void( [attachments enumerateObjectsUsingBlock:^(NSItemProvider *provider, NSUInteger idx, BOOL *stop) { if([provider hasItemConformingToTypeIdentifier:URL_IDENTIFIER]) { urlProvider = provider; - *stop = YES; } else if ([provider hasItemConformingToTypeIdentifier:TEXT_IDENTIFIER]){ textProvider = provider; - *stop = YES; } else if ([provider hasItemConformingToTypeIdentifier:IMAGE_IDENTIFIER]){ imageProvider = provider; - *stop = YES; } }];