我正在使用instagram-ios-sdk
. 我可以成功login
访问 Instagram 并获得访问令牌,但是之后当我尝试使用UIDocumentInteractionController
from发布图片时UIImagePickerController
,该图片没有发布。发送图片的代码如下:
(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
。我错过了什么吗?谁能帮我这个?
谢谢