Skip to content

Commit

Permalink
Loop through all attachments, no breaking
Browse files Browse the repository at this point in the history
  * 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
  • Loading branch information
felixyz committed Mar 25, 2020
1 parent 591e523 commit 9629251
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ios/ReactNativeShareExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}];

Expand Down

0 comments on commit 9629251

Please sign in to comment.