-
-
Save stelabouras/1634b0c3ef080a0aa733 to your computer and use it in GitHub Desktop.
- (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]; | |
} |
instagram://library?AssetPath=(assetsLibraryUrl) stopped working a while ago. Instagram developers probably moved to Photos framework and no longer use the AssetsLibrary.
Having this assumption I tried several other parameter names and found that instagram://library?LocalIdentifier=(localID) where localId is the localIdentifier of your PHAsset works for now.
This is still as undocumented as it was so it can break in any future version of the Instagram.
instagram://library?LocalIdentifier=(localID)
stopped working...
instagram://library?LocalIdentifier=(localID) stopped working for me as well
LocalIdentifier
works for me.
Using an unescaped local identifier along with the URL param OpenInEditor=1
seems to get it working again, at least currently.
Example: instagram://library?OpenInEditor=1&LocalIdentifier=DBD74ED9-4D9D-4F35-B12A-5B647944DDFE/L0/001
instagram://library?AssetPath=\(fileURLString)
starting crashing for me all of a sudden, changing to instagram://library?OpenInEditor=1&LocalIdentifier=\(fileLocalIdString)
works.
is there a way from preventing it showing the POST TO FEED / STORY that started showing up recently? I'd like to go directly to my feed
I am facing the same issue the image which i want to share from app isn't landing on Instagram image editor, its forcing me to choose photo from library or camera
Same issue as @innoravaneer
Thanks and i need same thing working for whatsapp Also so please can you share code for whatsApp ?
@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?
i'm having the same issue @mlagadhir, the url is not working.
This fails to create the url for instagram every time. have you had any luck?