Open bluey31 opened 7 years ago
I think I have found the code in question within ReactNativeShareExtension.m
. When extracting data from the extension context an error occurs along the pipeline returning the image. My suspicions are that it is because it exists in memory, and not in storage, but I may be wrong. Another possibility is that it is a special type of NSExtensionItem attachment that isn't being picked up.
(I have removed the URL and Text provider parsing so I could compact the code into one screenshot)
Maybe something like - loadDataRepresentationForTypeIdentifier:completionHandler:
or - loadFileRepresentationForTypeIdentifier:completionHandler:
needs to process the image instead?
Found the fix, PR created.
@bluey31 this is pretty good. Nice job. Look into it
I've re-opened the PR with a more thorough change, worth checking out.
The following project shows an example of a app that utilizes
react-native-share-extension
to the simplest level: https://github.com/bluey31/ShareTest11When the share extension is triggered from Photos, for example, the share extension persists and can be interacted with. Although, when the share extension is triggered from the iOS 11 screenshot editor (that is presented in iOS 11 when a screenshot is taken) the share extension crashes due to thanks from the line
const { type, value } = await ShareExtension.data()
(#60 ShareTest11Ext.js).I believe the way you harvest the photo is having trouble dealing with the fact the image is mid-edit...hope this helps.
Brendon