を使用して Instagram をアプリケーションに統合していますinstagram-ios-sdk
。Instagramへは正常にアクセストークンを取得できるのですが、その後fromlogin
を使って写真を投稿しようとすると画像が投稿されません。画像を送信するコードは次のとおりです。UIDocumentInteractionController
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
。何か不足していますか?誰でもこれで私を助けることができますか?
ありがとう