Skip to content

Instantly share code, notes, and snippets.

@stelabouras
Last active March 18, 2021 22:38
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stelabouras/1634b0c3ef080a0aa733 to your computer and use it in GitHub Desktop.
Save stelabouras/1634b0c3ef080a0aa733 to your computer and use it in GitHub Desktop.
Loads a Camera Roll Asset to Instagram (works for both photos & videos)
- (void)loadCameraRollAssetToInstagram:(NSURL*)assetsLibraryURL andMessage:(NSString*)message
{
NSString *escapedString = [assetsLibraryURL.absoluteString urlencodedString];
NSString *escapedCaption = [message urlencodedString];
NSURL *instagramURL = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@", escapedString, escapedCaption]];
[[UIApplication sharedApplication] openURL:instagramURL];
}
@rewaant
Copy link

rewaant commented Nov 26, 2020

Stopped working now. Any other way to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment