Instagram分享
来源:互联网 发布:航班数据 编辑:程序博客网 时间:2024/04/30 17:36
分享图片
The answer is that it is not pulling the video from the camera roll at all, it might just look like it is.
Documentation here: http://instagram.com/developer/mobile-sharing/iphone-hooks/
The relevant bit is the bottom section "Document Interaction".
You would do this by doing something like this:
NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"instagram.igo"];NSData *data = // set this yourselfNSError *error = nil;if (! [data writeToFile:filePath options:NSDataWritingAtomic error:&error]){ // error here}self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];self.documentInteractionController.delegate = self;self.documentInteractionController.UTI = @"com.instagram.exclusivegram";self.documentInteractionController.annotation = @{ @"InstagramCaption" : @"caption text here" };const BOOL couldOpen = [self.documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:myView animated:YES];
Set the data, the caption, and the view to present from yourself. Notice the UIDocumentInteractionController
is also a property. It should be retained somewhere and not just a local variable in a method because it needs to exist outside of that scope when the method completes.
分享视频
- (void)shareVideoWithInstagram {
[assetsLibrary writeVideoAtPathToSavedPhotosAlbum:[NSURL fileURLWithPath:videoPath] completionBlock:^(NSURL *assetURL, NSError *error) {
NSString *caption =@"Your caption";
NSURL *instagramURL = [NSURLURLWithString:[NSStringstringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@",
[[assetURLabsoluteString] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSetalphanumericCharacterSet]],
[captionstringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSetalphanumericCharacterSet]]]
];
if ([[UIApplicationsharedApplication] canOpenURL:instagramURL]) {
[[UIApplication sharedApplication] openURL:instagramURL];
}
}
- Instagram分享
- ios Instagram 分享
- 社交图片分享应用Instagram
- Instagram启示录 照片分享功能做到极致
- 转一篇Instagram的架构分享
- 关于使用 instagram api 开发分享功能
- 刚Instagram创始人的斯坦福分享会
- Flipagram:将Instagram照片制作成幻灯片分享给亲友
- Instagram的Material Design概念设计文章分享
- 国外第三方分享,包括Facebook,twitter,Instagram
- Instagram如何应对中国这个特殊市场?是否会推出视频分享应用?
- 国内图片社交应用升温 - facebook收购Instagram移动图片社交分享公司
- [PPT]来自instagram创始人的分享:如何成为一家十亿美元公司
- Instagram用户数突破8000万 用户分享照片数达40亿张
- 基于图片分享的移动医疗数据库,看Instagram怎么做移动医疗
- 基于 flask 框架的模拟instagram 图片分享网站的开发
- 基于 flask 框架的模拟instagram 图片分享网站的开发 2
- HTML5中canvas线性渐变的用法
- iOS 利用AFnetworking判断网络状态
- JSP的一些记录
- maven常用插件: 打包源码 / 跳过测试 / 单独打包依赖项
- HTTP Status 405 - Request method 'POST' not supported (Spring MVC)
- Instagram分享
- 内存碎片和memcached slab控制碎片方法
- Quartz2D简单使用(二)
- 安卓新闻客户端(五) ListView下拉刷新 XlistView解析
- 【Lua基础】Lua基本用法
- 华为OJ基础篇-整形数组合并
- JavaScript基础——文档对象模型(DOM)
- 23,选择排序
- Load Generator负载生成器