Last active
October 4, 2024 20:15
-
-
Save stelabouras/1634b0c3ef080a0aa733 to your computer and use it in GitHub Desktop.
Loads a Camera Roll Asset to Instagram (works for both photos & videos)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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]; | |
} |
@Jaydip-iOS, check this out: https://faq.whatsapp.com/en/iphone/23559013
`instagram://library?OpenInEditor=1&LocalIdentifier=+${encodedURL}`;
Worked for me :)
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
Thanks and i need same thing working for whatsapp Also so please can you share code for whatsApp ?