我正在使用instagram-ios-sdk
將Instagram集成到我的應用程序中。我可以成功地將login
發送給Instagram並獲取訪問令牌,但之後當我嘗試使用UIDocumentInteractionController
從UIImagePickerController
發佈圖片時,圖片不會發布。發送圖片的代碼如下給出:圖片不在ios上發佈instagram 6
(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
上。我錯過了什麼嗎?誰能幫我這個?
感謝
同樣的問題在這裏。 :(如果你確實搞清楚了,請你可以跟我分享你所做的事情 –
你們有沒有想過嗎? –