ShareSDK的简化压缩和使用样例
压缩 简化 样例 使用
2023-09-14 09:10:21 时间
share sdk 太大了 于是自己 開始简化, 删除了 ipad 的图片和 framework , 压缩了 sharesdk 中的 图片,用几k的图片 替换了几个 200多k 的图片
仅仅保留了 QQ 微博 、 sina 微博 、 微信 朋友圈、微信好友分享、QQ空间 这5个 基本的分享平台
改动压缩后的 大小。 全部图片都压缩过了
原始 大小。
使用 sharesdk 的分享流程
+(void)shareTitle:(NSString *)title content:(NSString *)content image:(UIImage *)img { //分享的 底ViewControoler id<ISSContainer> container = [ShareSDK container]; //能够 设置 sharesdk 弹出的底ViewController //[container setIPhoneContainerWithViewController:nil]; //自己主动授权 id<ISSAuthOptions> authOptions = [ShareSDK authOptionsWithAutoAuth:YES allowCallback:NO authViewStyle:SSAuthViewStyleModal viewDelegate:nil authManagerViewDelegate:nil]; //在授权页面中加入关注官方微博 [authOptions setFollowAccounts:@{SHARE_TYPE_NUMBER(ShareTypeSinaWeibo):[ShareSDK userFieldWithType:SSUserFieldTypeName valeu:@"哈哈哈啊哈啊哈哈_呃"]}]; //要分享的列表 NSArray *shareList = [ShareSDK getShareListWithType:ShareTypeSinaWeibo, ShareTypeTencentWeibo, ShareTypeQQSpace,ShareTypeWeixiSession,ShareTypeWeixiTimeline,nil]; //分享界面 选项 id<ISSShareOptions> shareOptions = [ShareSDK defaultShareOptionsWithTitle:title oneKeyShareList:shareList qqButtonHidden:YES wxSessionButtonHidden:NO wxTimelineButtonHidden:NO showKeyboardOnAppear:YES shareViewDelegate:nil friendsViewDelegate:nil picViewerViewDelegate:nil]; //加入分享的图片 id<ISSCAttachment> shareImage = nil; SSPublishContentMediaType shareType = SSPublishContentMediaTypeText; if(img) { shareImage = [ShareSDK pngImageWithImage:img]; shareType = SSPublishContentMediaTypeNews; } //分享的内容 id<ISSContent>publishContent=[ShareSDK content:content defaultContent:@"" image:shareImage title:title url:@"http://www.sharesdk.cn/" description:@"" mediaType:shareType]; //弹出分享菜单 [ShareSDK showShareActionSheet:container shareList:shareList content:publishContent statusBarTips:YES authOptions:authOptions shareOptions:shareOptions result:^(ShareType type, SSPublishContentState state, id<ISSStatusInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) { if (state == SSPublishContentStateSuccess) { NSLog(@"分享成功"); } else if (state == SSPublishContentStateFail) { NSLog(@"分享失败,错误码:%d,错误描写叙述:%@", [error errorCode], [error errorDescription]); } }]; }
上传资源慢了点
http://download.csdn.net/detail/li6185377/5422381
相关文章
- Linux Deepin同时解压多个taball压缩档案
- C#图片切割、图片压缩、缩略图生成
- Java IO--压缩流ZipOutputStream/ZipInputStream
- C#利用SharpZipLib解压或压缩文件夹实例操作
- java上传并压缩图片(等比例压缩或者原尺寸压缩)
- (Java实现) 洛谷 P1319 压缩技术
- HDU 3006 The Number of set(位运算 状态压缩)
- HDU 1429 胜利大逃亡(续)(DP + 状态压缩)
- Linux下的tar压缩解压缩命令详解
- 数字图像处理 位平面切片/压缩
- C# 下利用ICSharpCode.SharpZipLib.dll实现文件/文件夹压缩、解压缩
- Atitit 信息管理概论 艾提拉总结 信息的采集 信息格式转换 信息整合 信息的tag标注 信息的结构化 信息检索,,索引 压缩 信息分析 汇总 第1章 信息管理的基本概念 第
- Atiitt 自我学习法流程 1.预先阶段 1.1.目标搜索 资料搜索 1.2. 1.3.通过关联关键词 抽象 等领域 拓展拓宽体系树 1.4. 2.分析整理阶段 2.1.找出重点 压缩要学会
- 文件压缩(读取文件优化)
- 致远OA漏洞——本质上是先url编码+gzip压缩来绕过检测
- 35. 脱壳篇-UPX和WinUpack压缩壳的使用和脱法