参见英文答案 >
Pulling Instagram images to my app [closed] 2个
将应用程序与Instagram集成..如何做到这一点请提前帮助谢谢
这是我试过的代码
将应用程序与Instagram集成..如何做到这一点请提前帮助谢谢
这是我试过的代码
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]; }
解决方法
在iOS中使用Instagram API现在要简单得多.看看这个新的SDK
http://github.com/shyambhat/InstagramKit