【发布时间】:2013-01-17 04:17:00
【问题描述】:
我正在使用 instagram-ios-sdk 将 Instagram 集成到我的应用程序中。我可以成功地将login 发送到 Instagram 并获得访问令牌,但之后当我尝试使用来自UIImagePickerController 的UIDocumentInteractionController 发布图片时,图像没有发布。发送图片的代码如下:
(void)_startUpload:(UIImage *) image {
NSLog(@"Image Object = %@",NSStringFromCGSize(image.size));
NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.igo"];
[UIImageJPEGRepresentation(image, 1.0) writeToFile:jpgPath atomically:YES];
NSLog(@"file url %@",jpgPath);
NSURL *igImageHookFile = [[NSURL alloc] init];
igImageHookFile = [NSURL fileURLWithPath:jpgPath];
NSLog(@"File Url = %@",igImageHookFile);
documentInteractionController.UTI = @"com.instagram.photo";
[UIDocumentInteractionController interactionControllerWithURL:igImageHookFile];
[self setupControllerWithURL:igImageHookFile usingDelegate:self];
[documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}
(UIDocumentInteractionController *) setupControllerWithURL: (NSURL*) fileURL usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate {
NSLog(@"%@",fileURL);
UIDocumentInteractionController *interactionController =
[UIDocumentInteractionController interactionControllerWithURL: fileURL];
interactionController.delegate = interactionDelegate;
return interactionController;
}
我将图像转换为.ig 格式,分辨率为(612 *612)。但图片仍然没有发布在Instagram 上。我错过了什么吗?谁能帮我解决这个问题?
谢谢
【问题讨论】:
-
这里有同样的问题。 :(如果你知道了,请你分享一下你做了什么。
-
你们中有人想出来了吗?