# 分享
*****
组件提供微信、微信朋友圈、微信收藏、QQ、QQ空间、短信、邮箱等分享渠道。
可以通过下面方法,调用分享功能:
```
#import <TMShare/TMShare.h>
/*
/*
webLink 分享的web地址(可为空)
thumb 缩略图(可为空)
title 标题(因各三方平台限制,最多分享30个字符,超出部分将被截断)(可为空)
des 描述(因各三方平台限制,最多分享40个字符,超出部分将被截断)(可为空)
currentController 当前页面Controller(仅在ipad平台使用,iPhone可为空)
complete 回调
当以上参数都为空时,默认分享APP Icon
*/
- (void)showShare:(NSString *)webLink
thumbUrl:(id)thumb
title:(NSString *)title
descr:(NSString *)des
currentController:(UIViewController *)currentController
finish:(TMShareComplete)complete;
- (void)tm_showShare:(NSString *)webLink
thumbUrl:(id)thumb
title:(NSString *)title
descr:(NSString *)des
currentController:(UIViewController *)currentController
finish:(TM_ShareComplete)complete;
/**
分享图片
@param image 图片对象:包含url或者UIImage对象两种形式,如果为空,则默认分享APP Icon
@param complate 分享结果回调
*/
- (void)tm_showShareWithImage:(id)image
finish:(TM_ShareComplete)complate;
```
分享注意事项:
1.因受微信官方限制,分享时返回回调都是成功。
2.支持分享类型:文字,图片,文字+图片+链接。按照上列类型分享时,其他参数可为空。
3.我们提供的基础demo未配置默认分享key,如需测试分享,请按照下列步骤配置三方:
1)TMBaseConfig.plist文件中的features中配置三方key
2)在工程配置的info里面配置URL Types
3)请在info.plist中配置ShareSDK的key:MOBAppKey和MOBAppSecret配置
4)在info.plist文件中配置白名单
```
<key>LSApplicationQueriesSchemes</key>
<array>
<string>sinaweibo</string>
<string>sinaweibohd</string>
<string>sinaweibosso</string>
<string>sinaweibohdsso</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>
<string>wechat</string>
<string>weixin</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>wtloginmqq2</string>
<string>mqq</string>
<string>mqqapi</string>
<string>timapi</string>
<string>mqzoneopensdk</string>
<string>mqzoneopensdkapi</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapiV2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqqopensdkapiV4</string>
</array>
```