ajith-ab / react-native-receive-sharing-intent

A React Native plugin that enables React Native apps to receive sharing photos, videos, text, urls or any other file types from another app
MIT License
297 stars 108 forks source link

Sharing intents with both text and file types (iOS) #85

Open lukemcgregor opened 3 years ago

lukemcgregor commented 3 years ago

Ive been using this library to share files, however Ive run into a bit of an issue with the Adobe Sign and Fill app.

Ive spent a bunch of time digging into why this is and it comes down to the fact that the sign and fill app is sharing both text (a note about the file as kUTTypeText) and the file itself as kUTTypeFileURL. What is then happening is that this library is detecting the text as the second type and because its the last in the array of shares (eg if index == (content.attachments?.count)! - 1) it's only sharing the text specific parts. This means the file itself isn't sent through with the share.

Has been a bit of a mission to work all this out but I think the upshot is that redirectToApp should not be typed to text/file etc and instead on the other end (RecieveSharingIntent.swift) we should assume that any of those components may be present.

Hope this makes sense, I will try my hand at a fix shortly

dmitrizagidulin commented 2 years ago

+1 to this issue and @lukemcgregor's fix!