Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Media on Instagram #2

Open
brainbrain34 opened this issue Feb 5, 2016 · 14 comments
Open

No Media on Instagram #2

brainbrain34 opened this issue Feb 5, 2016 · 14 comments

Comments

@brainbrain34
Copy link

Hi im trying to pass a video to share on instagram i have the correct link i get it from my camera roll:

  • var video = 'assets-library://asset/asset.MOV?id=231690C4-0DAC-437F-BE98-5C0A0F52F47E&ext=MOV';
    var caption=''test";

i have a function to call on press button to go to instagram:

  • Instagram() {
    console.log(video+':'+caption)
    RNInstagramShare.share(video,caption);
    }

Then when i press with console log the params are ok and goes correctly to instagram, but dont select the video and instagram show me a message:
"No Media Photos and videos in your camera roll will appear here"
if select manually i can share, how i can fix it to get the video i pass to share like on your demo ¿? i tried with images and happens the same.

image

@philsippl
Copy link

+1 exactly the same problem for me!

@Toomaie
Copy link

Toomaie commented May 4, 2016

Same here. Did you guys found any solution?

The API used in this library seems deprecated as the official one no longer has the instagram://library endpoint https://www.instagram.com/developer/mobile-sharing/iphone-hooks/

@philsippl
Copy link

Yeah I made it work for me by changing to following undocumented url scheme: instagram://library?LocalIdentifier=PHASSET_ID (http://stackoverflow.com/questions/34226433/instagram-hooks-pre-select-media-issue)
If you only have a AssetPath like library://asset/asset.MOV?id=2A2CE6C9-C178-4395-977B-E6F159BF6D5E&ext=MOV, the PHASSET_ID is simply the id in the url followed by a /L0/001. So in this example the correct url for instagram would be: instagram://library?LocalIdentifier=2A2CE6C9-C178-4395-977B-E6F159BF6D5E/L0/001.
Both things are completely undocumented and not officially supported, so this might break in the future, but I really needed a quick workaround.

@rgovindji
Copy link

@philsippl Does this still work for you, I tried it but can't get the media to open in instagram.

@philsippl
Copy link

@rgovindji I've tested it and right now it still seems to work. You have to make sure that the image is in the gallery, so the instagram app has permissions for the file.

@rgovindji
Copy link

@philsippl I can see the image in the library but I have to manually select it within Instagram.

Do you see something wrong with my AssetPath?

Original: assets-library://asset/asset.JPG?id=2519299C-936A-45B8-9F56-F3D0C7ED0661&ext=JPG
AssetPath: instagram://library?LocalIdentifier=2519299C-936A-45B8-9F56-F3D0C7ED0661/L0/001

@philsippl
Copy link

@rgovindji The url seems to be fine. Have you changed the plugin accordingly?
This is how I changed the plugin to make it work:

NSURL *instagramURL       = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?LocalIdentifier=%@&InstagramCaption=%@", assetsLibraryURL, escapedCaption]];

The assetsLibraryURL is now the id.
You can leave out the caption, this field is not working anymore.

@rgovindji
Copy link

@philsippl I did not, I'll try that now!

@krzkaczor
Copy link

krzkaczor commented Sep 6, 2016

I think that you need only that long ID. I extracted it in following way (and it works :D) :

NSString* localId = [assetURL.absoluteString substringWithRange:NSMakeRange(36, 36)]; //we need to get id from whole URL
NSURL *instagramURL       = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?LocalIdentifier=%@", localId]];

@den-ree
Copy link

den-ree commented Feb 27, 2017

I have problem with instagram://library?LocalIdentifier=AssetId after last update with multiple photos.

@MattTimmons
Copy link

Is anyone percent encoding the localIdentifier?

@den-ree
Copy link

den-ree commented Jan 12, 2018

@MattTimmons does it work for you?

@MattTimmons
Copy link

I am not percent encoding the localIdentifier. But, I tried to and still have an issue.
To be clear, I am able to use this on an image just fine. But when using a video, instagram sees it on the initial "editor" screen. But then after your click "feed" it fails to see it with this image.

img_0975

@MattTimmons
Copy link

and update to my post.. I was using instagram://library?OpenInEditor=1&LocalIdentifier=
and not instagram://library?LocalIdentifier= I found the "openIn" on a stackoverflow post I believe.
Just test, and as of now instagram://library?LocalIdentifier= is working for me with both images and video.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants