IOS iPhone SDK integrating with instagram app

Integrating the application with instagram .. How can I do this, please help in advance is the code that I tried

NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.ig"]; UIImage *image = [UIImage imageNamed:@"instagram.jpeg"]; NSData *imageData = UIImagePNGRepresentation(image); [imageData writeToFile:savedImagePath atomically:YES]; NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath]; NSLog(@"%@",imageUrl); UIDocumentInteractionController *docController = [[UIDocumentInteractionController alloc] init]; docController.delegate = self; docController.UTI = @"com.instagram.photo"; docController.URL = imageUrl; [docController setURL:imageUrl]; [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; } 
+4
source share
2 answers

Using the Instagram API on iOS is a lot easier. Check out this new SDK http://github.com/shyambhat/InstagramKit

+4
source

You should check out InstagramShareiOS and How to share an image on Instagram in iOS?

Please note that you cannot post to Instagram through the API, you can check and launch the Instagram application with a ready-to-publish image. Instagram has not opened its API for publication, and I doubt that they will, given that they want users to (1) use their application and (2) use their filters, automatically configure other functions that contribute to Instagram experience.

In addition, once you leave your application and launch Instagram, there is no automatic way to return, FWIW.

0
source

Source: https://habr.com/ru/post/1484611/


All Articles