react-native-share / react-native-share

Social share, sending simple data to other apps.
https://react-native-share.github.io/react-native-share
MIT License
3.64k stars 946 forks source link

Shares the last photo in the library instead of the provided file. #358

Closed nicubarbaros closed 3 years ago

nicubarbaros commented 6 years ago

Steps to reproduce

  1. Build for IOS device.
  2. Before opening the app, make a photo/screenshot
  3. Share.shareSingle. for Instagram
  4. 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-share

Version: 1.1.1

Update.

While using Share.open and selecting Instagram will work. With Share.singleShare still gets the last photo.

jgcmarins commented 6 years ago

Interesting. Can we have a repo to reproduce?

nicubarbaros commented 6 years ago

Let me see what can I do.

Tried to send a base 64 file, and still doesnot work.

While the base64 code is legit.

data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAARsAAAD/CAYAAADBj3IBAAABfGlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGAqSSwoyGFhYGDIzSspCnJ3UoiIjFJgv8PAzcDDIMRgxSCemFxc4BgQ4MOAE3y7xsAIoi/rgsxK8/x506a1fP4WNq+ZclYlOrj1gQF3SmpxMgMDIweQnZxSnJwLZOcA2TrJBUUl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JkEA3CFBsugGPTUmABOInQLGJnxVrkgAJdIMAxaYb8NiUBEggfgIUm/hZsSYJkEA3CHCnvm7AY1MSIIH4CXCnvvhZsSYJkEA3CHAZ1Q14bEoCJBA/AYpN/KxYkwRIoBsEKDbdgMemJEAC8ROg2MTPijVJgAS6QcDT+9nk5OZ0Aw2bkgAJJJIAZzaJpElbJEACMQlQbGKiYQEJkEAiCVBsEkmTtkiABGISoNjERMMCEiCBRBKg2CSSJm2RAAnEJECxiYmGBSRAAokkQLFJJE3aIgESiEmAYhMTDQtIgAQSSYBik0iatEUCJBCTAMUmJhoWkAAJJJIAxSaRNGmLBEggJgHu1BcTDQtIgAQSSYA79SWSJm2RAAnEJMBlVEw0LCABEkgkAYpNImnSFgmQQEwCnt7PpqG+IebAWUACJNCzBDiz6VnevBoJ+JYAxca3rufASaBnCVBsepY3r0YCviVAsfGt6zlwEuhZAhSbnuXNq5GAbwlQbHzreg6cBHqWAMWmZ3nzaiTgWwIUG9+6ngMngZ4lQLHpWd68Ggn4lgDFxreu58BJoGcJUGx6ljevRgK+JUCx8a3rOXAS6FkCFJue5c2rkYBvCXCnPt+6ngMngZ4lwJ36epY3r0YCviXg6f1scnJzfOtYDpwE3EaAz2zc5hH2hwQ8SoBi41HHclgk4DYCFBu3eYT9IQGPEqDYeNSxHBYJuI0AxcZtHmF/SMCjBCg2HnUsh0UCbiNAsXGbR9gfEvAoAYqNRx3LYZGA2whQbNzmEfaHBDxK4P8BakY1DzM8Q0MAAAAASUVORK5CYII=

Can be checked here Online Converter

nicubarbaros commented 6 years ago

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.

 shareToInstagram = async (
    mediaUrl = "",
    appendExt = "igo",
    type = "image/jpeg"
  ) => {
    try {
      const tempBlob = await RNFetchBlob.config({
        fileCache: true,
        appendExt
      }).fetch("GET", mediaUrl, {});

      const savedToCameraRoll = await CameraRoll.saveToCameraRoll(
        tempBlob.path()
      );

      const last = await CameraRoll.getPhotos({
        first: 1,
        assetType: "All"
      });
      let shareOptions = {
        url: last.edges[0].node.image.uri,
        type,
        social: Share.Social.INSTAGRAM
      };

      const response = await Share.shareSingle(shareOptions);

      tempBlob.flush();

    } catch (error) {

      console.log(error);
    }
  };
jgcmarins commented 6 years ago

@nicubarbaros awesome! I think we should add this information to README. Can you send a PR?

nicubarbaros commented 6 years ago

Sure. I'll try to make it ASAP

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open.

jgcmarins commented 5 years ago

We did a new release, can you try it? v1.2.0. Thank you.

itsdante commented 5 years ago

sure i’d love to try it out

On Mon, 27 May 2019 at 21.38 João Marins notifications@github.com wrote:

We did a new release, can you try it? v1.2.0. Thank you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-share/issues/358?email_source=notifications&email_token=AD4436MA22CKFBDL23Q4EADPXPW7RA5CNFSM4FS44WE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWJ63CI#issuecomment-496233865, or mute the thread https://github.com/notifications/unsubscribe-auth/AD4436JABQWXXMRRMW6LRZTPXPW7RANCNFSM4FS44WEQ .

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open.

stale[bot] commented 5 years ago

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

ymc-thzi commented 4 years ago

Hmm, still having exact the same issue with v1.2.1

MateusAndrade commented 4 years ago

Hey, @ymc-thzi can you try our latest versions? There's some time since we released 1.2.1. 😅

You can have a look at the changes here: https://github.com/react-native-community/react-native-share/compare/v1.2.1...v3.7.0

vineethvijayan commented 4 years ago

Still not working, I am trying to share a video to instagram/facebook/twitter. I am trying with share.shareSingle which dosen't work on any scenario. share.open works for facebook & twitter not for instagram.

I have followed almost all combinations I can find online. I download a video using fetchBlob then save the video to cameraroll. then try to share the video. In Share.open if I give path from fetchBlob works. not the path from cameraroll

Please help I am at this for a couple of days.

pvinis commented 3 years ago

I feel we should re-open this. Even in the solution comment a bit above, it only works because the image is saved in the camera roll. But we shouldn't need to save in the camera roll in order to share on Instagram feed, because that means we need to also delete it after, and that needs a user interaction. If it works for stories, it should work for feed too.

Is that an Instagram limitation/weirdness or a bug on this lib here?

eraldoforgoli commented 3 years ago

Still not working. This issue still happens to me on iOS. On Android works as expected.

trackwell-mike commented 3 years ago

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?

stale[bot] commented 3 years ago

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

trackwell-mike commented 3 years ago

Hoping we can keep this issue open.

@MateusAndrade just curious if you had a chance to review this when you reopened it last month? Thank you!

pvinis commented 3 years ago

if I can chime in here.. IG stories work fine. IG feed shares the latest local library photo instead of the one I give.

That means that for now they only way to make it work, which is very very hacky, is to save the image I want to share in the local library, share on IG feed, then delete the image. not shippable.

does anyone have any ideas what/where the problem might be?

pvinis commented 3 years ago

definitely we should reopen this.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open.

trackwell-mike commented 3 years ago

Hopefully this can be reopened for more discussion.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open

trackwell-mike commented 3 years ago

Hopefully this can be reopened for more discussion.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open

jblemee commented 3 months ago

Still not fixed