Skip to content

Conversation

@AndrewHenderson
Copy link
Collaborator

Reverts changes in 1e98f58.

Changes in that PR cause inability to use image data for fetch requests. I personally find that I am unable to upload images from the share extension if the changes linked are included. This PR gets things working again.

@brenwarwcdg Please review your work. I'm not strong in Objective-C, but there appears to be an issue. It seems in these changes, images are assumed to be png for iOS. 5540d95#diff-cd365a662ae840f4beb6a01a1c8ffa1fR106

@AndrewHenderson AndrewHenderson merged commit 3db5320 into master Dec 19, 2018
@AndrewHenderson AndrewHenderson deleted the ios_image_processing_fix branch December 19, 2018 18:08
frenberg added a commit to frenberg/react-native-share-extension that referenced this pull request Dec 20, 2018
@chaitanyadeorukhkar
Copy link

chaitanyadeorukhkar commented Jun 13, 2019

Reverting these changes will result in the share extension receiving a URL instead of an Image from apps like Photos. This URL cannot be used within RN.

The approach taken earlier was correct. We create a temporary file where we write the image to if it is a URL. This way we are able to use that image within RN.

The only issue there was:

Assuming the name of each file as "RNSE_TEMP_IMG"

NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"RNSE_TEMP_IMG"]; 

Assuming the extension of each file as "png"

NSString *fullPath = [filePath stringByAppendingPathExtension:@"png"];

Instead of this if we can extract the file name & extension from the URL/Image, use that in the full path of the created temporary file, we will have a proper file shared with the correct extension and name.

What do you think @AndrewHenderson @brenwarwcdg ?

I am not too strong with Objective-C but I'll try sending a PR if you think this approach could help fix both the problems (unusable URL & incorrect extension)

Edit - Created a PR: #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants