react-native-share: Share.open options are not working well (title, icon does not show)
Ask your Question
I want to use Share.open() with my custom values, but it does not work as expected.
In iOS, activityItemSources option goes well but it does not display icon that I want to show.
Moreover in android, title does not come up and I can see just only messages and url. (In addition, I want to show message only in sharesheet and share the url value only, but android shows and shares both message and url. Isn’t there any options to customize it?)
This is a capture that what it goes like

and this is my code
const onShare = async () => {
try {
const url = 'https://real-value-to-share-with'
const title = 'HI THIS IS TITLE'
const message = 'and this is just a message'
const icon = 'data:<data_type>/<file_extension>;base64,<base64_data>'
const shareResponse = await Share.open(
Platform.select({
ios: {
failOnCancel: false,
activityItemSources: [
{
placeholderItem: { type: 'text', content: message },
item: { default: { type: 'url', content: url } },
linkMetadata: { title, originalUrl: message, icon },
},
],
},
default: { failOnCancel: false, message, url, title, },
}),
)
console.log(shareResponse)
} catch (error) {
console.error(error)
}
}
What I want to do
- show title and message individually
- distinguish value to show in ShareSheet from value to share with (just like what iOS does now)
- (optional) show custom icon
What I use
| libraries | version |
|---|---|
| react-native | 0.63.2 |
| react-native-share | ^3.7.0 |
| typescript | ^3.8.3 |
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 16
I found that in ios, regardless of
iconoption, if there is anyurlororiginalUrloption, it just shows default url icon.
but if not, (if there is
titleonly or no options exist) it shows the app iconall above case, I didn’t give any
iconorimageoptions does there anyone know that is this bug or not??any updates on this?
Any update? Having the same issue.
@MateusAndrade Any news about this?
Well, the thing about the stale bot is that it is on objective measure of how much the community cares. No one apparently cares enough to propose a PR, so it is objectively not interesting. Real time actually passed. Nothing happened. Or someone would have proposed a PR. Open Source software is not magic, it requires effort.