Trong Ứng dụng của tôi, tôi chia sẻ hình ảnh trên Instagram. Nó hoạt động tốt trong ứng dụng của tôi.Chia sẻ văn bản với Hình ảnh trên Instagram trong ios
Tôi đang sử dụng mã sau.
@property (nonatomic, retain) UIDocumentInteractionController *dic;
CGRect rect = CGRectMake(0 ,0 , 0, 0);
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIGraphicsEndImageContext();
NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/test.igo"];
NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", jpgPath]];
// NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", screenshot]];
self.dic.UTI = @"com.instagram.photo";
self.dic = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.dic=[UIDocumentInteractionController interactionControllerWithURL:igImageHookFile];
[self.dic presentOpenInMenuFromRect: rect inView: self.view animated: YES ];
- (UIDocumentInteractionController *) setupControllerWithURL: (NSURL*) fileURL usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate {
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL: fileURL];
interactionController.delegate = interactionDelegate;
return interactionController;
}
Bây giờ tôi cũng muốn chia sẻ một số văn bản với hình ảnh.
Như được hiển thị trong Hình ảnh bên dưới. Trong "Viết chú thích", tôi muốn một số văn bản tùy chỉnh mặc định cho ví dụ. "Chia sẻ hình ảnh này".
Tôi làm cách nào để thực hiện việc này?
Cảm ơn trước ...
Sửa
Tôi mở Instagram từ ứng dụng của tôi để chia sẻ hình ảnh và nó hoạt động tốt.
Nhưng tôi có thể kiểm tra xem người dùng đã chia sẻ thành công hay không?
Có nghĩa là tôi muốn thực hiện một số hành động trong DB của mình khi người dùng chia sẻ thành công hình ảnh.
Tôi làm cách nào để thực hiện việc này?
này, điều này không hiệu quả đối với tôi. –
bất kỳ cài đặt nào khác để thêm văn bản và hình ảnh ..? –