Shares the last photo in the library instead of the provided file.
See original GitHub issueSteps to reproduce
- Build for IOS device.
- Before opening the app, make a photo/screenshot
- Share.shareSingle. for Instagram
- Magic happens here. Instead of the URL I am trying to share, it takes the first photo in the library I made in step 2.
Expected behaviour
It should load (share) the image I am giving in the URL
param
const url = 'https://d29fp8qybdwwik.cloudfront.net/xgowQvXyP624QXwhQ/mBRfn2fcwD-franciele-cunha-596987-unsplash.jpg'
RNFetchBlob.config({
fileCache: true,
appendExt: "jpeg"
})
.fetch("GET", url, {})
.then(response => {
let shareOptions = {
url: "file://" + response.path(),
type: "image/jpeg",
social: Share.Social.INSTAGRAM
};
Share.shareSingle(shareOptions)
.then(res => {
//Remove files from cache
response.flush();
})
.catch(err => {
});
});
url is - file:///var/mobile/Containers/Data/Application/C25DE66E-A60E-4503-B2A9-2A5659D9692E/Documents/RNFetchBlob_tmp/RNFetchBlobTmp_by9mv9rtja9sxvip0z3wup.jpeg
Actual behavior
It shares the last made photo (device) and not the image I am passing to the URL param
PS: It worked fine untill I made a screenshot 😭.
Environment
- React Native version: ^0.56.0
- React Native platform + platform version: Iphone 7, IOS 11.4.1
react-native-share
Version: 1.1.1
Update.
While using Share.open
and selecting Instagram will work. With Share.singleShare
still gets the last photo.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:25 (3 by maintainers)
Top Results From Across the Web
Shares the last photo in the library instead of the provided file.
Build for IOS device. ... Magic happens here. Instead of the URL I am trying to share, it takes the first photo in...
Read more >View photos and videos shared with you on iPhone
View photos and videos shared with you on iPhone · Tap a photo to view it in full screen, save it to your...
Read more >Share photos & videos - Android - Google For Families Help
You can share photos, videos, albums, and movies with any of your contacts, even if they don't use the Google Photos app.
Read more >Google Photos - Apps on Google Play
Google Photos is the home for all your photos and videos, automatically organized and easy to share. - “The best photo product on...
Read more >How do I share a photo or video in GroupMe?
You can share photos and videos to your GroupMe chats then view and save them as you want. ... From the Photo library,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey. I finally made it work, by saving the media to Camera Roll and then taking the absolute path from there. In case anyone wants to know my solution please check this code. Works both for image and video. Tested only for IOS, I think the android needs to append
file://
before the uri.We’re having this issue as well, and I’d like to clarify that this only happens when sharing to Instagram Feed (enum: INSTAGRAM), not Instagram Stories (enum: INSTAGRAM_STORIES).
@MateusAndrade Does this work for you, sharing to Instagram Feed in iOS?