- (void)initializePlat

{

//添加新浪微博应用

[ShareSDK connectSinaWeiboWithAppKey:@"3201194191"

appSecret:@"0334252914651e8f76bad63337b3b78f"

redirectUri:@"http://appgo.cn"];

//添加腾讯微博应用

[ShareSDK connectTencentWeiboWithAppKey:@"801307650"

appSecret:@"ae36f4ee3946e1cbb98d6965b0b2ff5c"

redirectUri:@"http://www.sharesdk.cn"];

//添加QQ空间应用

[ShareSDK connectQZoneWithAppKey:@"100371282"

appSecret:@"aed9b0303e3ed1e27bae87c33761161d"];

//添加微信应用

[ShareSDK connectWeChatWithAppId:@"wx460cdac783d396b1" wechatCls:[WXApi class]];

//添加QQ应用  100510022    QQ0F0A941E

[ShareSDK connectQQWithAppId:@"QQ0F0A941E" qqApiCls:[QQApi class]];

}

- (BOOL)application:(UIApplication *)application

handleOpenURL:(NSURL *)url

{

return [ShareSDK handleOpenURL:url

wxDelegate:self];

}

- (BOOL)application:(UIApplication *)application

openURL:(NSURL *)url

sourceApplication:(NSString  *)sourceApplication

annotation:(id)annotation

{

return [ShareSDK handleOpenURL:url

sourceApplication:sourceApplication

annotation:annotation

wxDelegate:self];

}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions

{

//参数为ShareSDK官网中添加应用后得到的AppKey

[ShareSDK registerApp:@"10ce745008ef"];

[self initializePlat];

**************************************************************

#pragma mark - 分享

-(void)onShareSoftwear

{

NSLog(@"分享");

NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"ShareSDK" ofType:@"jpg"];

//构造分享内容

id<ISSContent> publishContent = [ShareSDK content:@"广源铝业软件"

defaultContent:@"广源铝业"

image:[ShareSDK imageWithPath:imagePath]

title:@"广源铝业"

url:@"http://www.apple.com/itunes//us/app"

description:@"广源铝业下载"

mediaType:SSPublishContentMediaTypeNews];

//自己设置分享平台列表

NSNumber *sinaWeiBo=[NSNumber numberWithInt:ShareTypeSinaWeibo];

NSNumber *qqWeiBo=[NSNumber numberWithInt:ShareTypeTencentWeibo];

NSNumber *weiXinSpace=[NSNumber numberWithInt:ShareTypeWeixiTimeline];

NSArray * myShareList=  [ShareSDKcustomShareListWithType:sinaWeiBo,qqWeiBo,weiXinSpace,nil];

//分享设置  就是分享面板上的某些内容的显示样式

id<ISSShareOptions> shareOptions =[ShareSDK defaultShareOptionsWithTitle:@"一键分享"

oneKeyShareList:nil

cameraButtonHidden:NO

mentionButtonHidden:NO

topicButtonHidden:NO

qqButtonHidden:YES

wxSessionButtonHidden:YES

wxTimelineButtonHidden:YES

showKeyboardOnAppear:NO

shareViewDelegate:nil

friendsViewDelegate:nil

picViewerViewDelegate:nil ];

[ShareSDK showShareActionSheet:nil

shareList:myShareList

content:publishContent

statusBarTips:YES

authOptions:nil

shareOptions: shareOptions

result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {

if (state == SSResponseStateSuccess)

{

NSLog(@"分享成功");

}

else if (state == SSResponseStateFail)

{

NSLog(@"分享失败,错误码:%d,错误描述:%@", [error errorCode], [errorerrorDescription]);

}

}];

}

iOS 自定义 shareSDK 容器的更多相关文章

  1. iOS 自定义转场动画浅谈

    代码地址如下:http://www.demodashi.com/demo/11612.html 路漫漫其修远兮,吾将上下而求索 前记 想研究自定义转场动画很久了,时间就像海绵,挤一挤还是有的,花了差不 ...

  2. 【iOS自定义键盘及键盘切换】详解

    [iOS自定义键盘]详解 实现效果展示: 一.实现的协议方法代码 #import <UIKit/UIKit.h> //创建自定义键盘协议 @protocol XFG_KeyBoardDel ...

  3. 自定义Docker容器的 hostname

    自定义Docker容器的 hostname   作者: John Deng 原创内容,欢迎传播,请注明出处:http://www.cnblogs.com/johnd/p/set-docker-host ...

  4. WPF中实现自定义虚拟容器(实现VirtualizingPanel)

    WPF中实现自定义虚拟容器(实现VirtualizingPanel) 在WPF应用程序开发过程中,大数据量的数据展现通常都要考虑性能问题.有下面一种常见的情况:原始数据源数据量很大,但是某一时刻数据容 ...

  5. iOS自定义的UISwitch按钮

    UISwitch开关控件 开关代替了点选框.开关是到目前为止用起来最简单的控件,不过仍然可以作一定程度的定制化. 一.创建 UISwitch* mySwitch = [[ UISwitchalloc] ...

  6. 如何实现 iOS 自定义状态栏

    给大家介绍如何实现 iOS 自定义状态栏 Sample Code: 01 UIWindow * statusWindow = [[UIWindow alloc] initWithFrame:[UIAp ...

  7. iOS自定义组与组之间的距离以及视图

    iOS自定义组与组之间的距离以及视图 //头视图高度 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(N ...

  8. iOS 自定义转场动画

    代码地址如下:http://www.demodashi.com/demo/12955.html 一.总效果 本文记录分享下自定义转场动画的实现方法,具体到动画效果:新浪微博图集浏览转场效果.手势过渡动 ...

  9. iOS自定义转场动画实战讲解

    iOS自定义转场动画实战讲解   转场动画这事,说简单也简单,可以通过presentViewController:animated:completion:和dismissViewControllerA ...

随机推荐

  1. PhysX

    [PhysX] 1.施加力: ))) { //施加一个力,X轴方向力度为1000,Y轴方向力度为1000 addFrceObj.rigidbody.AddForce (, , ); } ))) { / ...

  2. mvn安装jar文件到本地

    mvn install:install-file -DgroupId=com.jfinal -DartifactId=jfinal -Dversion=2.3 -Dpackaging=jar -Dfi ...

  3. ADT-bundle

    eclipse 弹出 Version 1.4.2_03 of the JVM not suitable for this product.Version1.6or geeater is requir ...

  4. 闲置的eSATA接口,会影响Windows 7的启动速度

      为方便用户连接外置硬盘等设备,很多中高 端主板上都有至少一个eSATA接口.事实上,很多人可能根本就不用eSATA接口,你想过没有,正是这个无所事事的eSATA接口,可能无意中就拖慢了 你的Win ...

  5. CodeForces 534B Covered Path (水题)

    题意:给定两个速度,一个一初速度,一个末速度,然后给定 t 秒时间,还每秒速度最多变化多少,让你求最长距离. 析:其实这个题很水的,看一遍就知道怎么做了,很明显就是先从末速度开始算起,然后倒着推. 代 ...

  6. PHP导出数据库数据字典脚本

    <?php /** * mysql数据字典在线生成 * @author change */ //配置数据库 $dbserver = "192.168.1.218:3306"; ...

  7. UI:触摸事件 与 事件的回应

    事件分类:晃动.触摸.远程控制(如遥控器.红外控制) 触摸开始时候的方法(判断单击,双击,三击事件可以写在这里) -(void)touchesBegan:(NSSet *)touches withEv ...

  8. Jquery 提示

    1  文字提示: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww ...

  9. github 多帐户使用

    同一台电脑有2个github账号?咋办 比如一个公司账号一个个人账号. 私人账号如下: 邮箱example@126.com 账号:example 公司工作账号如下: work@xx.com 账号:my ...

  10. Android Studio Push rejected: Push to origin/Alpha1.0 was rejected

    android studio git 右键项目, git pull 刷新选择Alpha1.0同步后,再commit and push