在我的应用程序中,我在Instagram上分享图像。它在我的应用程序中运行良好。在ios的Instagram上分享带有图片的文字
我正在使用以下代码。
@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;
}
现在我还想分享一些文字与图像。
如下图所示。在“编写标题”中,我想为例如一些默认的自定义文本。 “分享这张照片”。
我该怎么做?
在此先感谢...
编辑
我从我的应用程序打开Instagram的分享图像,它工作正常。
但我可以检查用户是否已成功共享它吗?
表示我想在用户成功分享图像时在我的数据库中执行某些操作。
我该怎么做?
嘿,这不适合我。 –
添加文本和图像的任何其他设置..? –