react-native-share-menu
react-native-share-menu copied to clipboard
User input not sent to RN when sharing an image on iOS
Hi, I am using this with the basic iOS UI for Share extension. After you share an image (e.g. from a browser) you get a popup where you can input text and you see the small image preview. However, the text is not sent along with the image URL to ReactNative. Instead, it is stripped from the data somehow and only the image URL is accessible.
This is IMO confusing to users and the typed text should be sent with the extraData field. Is there a way to fix this?
First of all, thanks for this Library, it is working super great and easy in both platforms!
@Laurian @caiosba @Gustash is there any way to avoid this user Input on iOS ?
Thanks! Matt.
Having this issue as well, ideally you would have the option to either remove the text input field or have the text from that field be sent to the app. I guess a workaround would involve taking advantage of the custom iOS Share View feature however it would be nice to be able to have it work as previously mentioned without creating a custom view.
@LPitonakova @matamicen So my workaround was to follow the instructions for setting up a Custom iOS Share View and then do the following:
In my share extension's Info.plist
file, I set the following so that the share modal was transparent:
<key>ReactShareViewBackgroundColor</key>
<dict>
<key>Red</key>
<integer>0</integer>
<key>Green</key>
<integer>0</integer>
<key>Blue</key>
<integer>0</integer>
<key>Alpha</key>
<integer>0</integer>
<key>Transparent</key>
<true/>
</dict>
Then, in my index.share.js
file, I put the following so that the modal just passes the data to the app:
import { AppRegistry } from 'react-native'
import { ShareMenuReactView } from 'react-native-share-menu'
const IosShareModal = () => {
ShareMenuReactView.continueInApp()
// ShareMenuReactView.dismissExtension()
return (<></>)
}
AppRegistry.registerComponent('ShareMenuModuleComponent', () => IosShareModal)
So this makes sharing images to the iOS app function basically the same as the Android app.
You do see an almost completely transparent modal for a brief second which isn't a huge deal but if you wanted to, instead of having the modal return a blank view, you could put some copy or something in there saying "Sharing to My App..." or something like that.
Hope this helps!
EDIT: I ran into an issue where the app wouldn't open sometimes. Removing the dismissExtension()
method seemed to fix it.
thanks @kodie :)
Sorry to hijack this thread, but I need help with actually using continueInApp() - wondering if any of you here who seem to be using it successfully can lend a hand: https://github.com/meedan/react-native-share-menu/issues/155