- (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. MacOSX快捷键

    [MacOSX快捷键] 关闭显示器:Shift + Ctrl + 退出键 休眠:Command + Option + 退出键 关机:Ctrl + Option + Command + 退出键 打开文件 ...

  2. Mysql SQL优化&执行计划

    SQL优化准则 禁用select * 使用select count(*) 统计行数 尽量少运算 尽量避免全表扫描,如果可以,在过滤列建立索引 尽量避免在where子句对字段进行null判断 尽量避免在 ...

  3. Python基础 练习题

    DAY .1 1.使用while循环输出 1 2 3 4 5 6     8 9 10 n = 1 while n < 11: if n == 7: pass else: print(n) n ...

  4. apiCode/1/1.1/1.1.1

    public abstract class myClass { private string id = ""; private string name = "" ...

  5. HDU2227Find the nondecreasing subsequences(树状数组+DP)

    题目大意就是说帮你给出一个序列a,让你求出它的非递减序列有多少个. 设dp[i]表示以a[i]结尾的非递减子序列的个数,由题意我们可以写出状态转移方程: dp[i] = sum{dp[j] | 1&l ...

  6. OC:Block语法、Block使用、Block实现数组排序

    Block //定义一个求两个数最大值函数 int maxValue (int ,int); //函数的实现 int maxValue (int a, int b){ return  a > b ...

  7. 基于Emgu cv的图像拼接(转)

    分类: 编程 C# Emgu cv Stitching 2012-10-27 11:04 753人阅读 评论(1) 收藏 举报 在新版本的Emgu cv中添加了Emgu.CV.Stitching,这极 ...

  8. Android平台NDK编程

    转自:http://blog.csdn.net/wangbin_jxust/article/details/37389383 之前在进行cocos2dx开发时,已经详细介绍了如何将win32的c++代 ...

  9. Eclipse和Android Studio中的DDMS使用时什么不同?

    http://www.jb51.net/softjc/454131.html Eclipse和Android Studio中的DDMS使用时什么不同? 相信很多经常开发Android应用的朋友应该都接 ...

  10. 编写一个JavaScript函数 parseQueryString,把URL参数解析为一个对象

    var url="http://www.taobao.com/index.php?key0=0&key1=1&key2=2"; function parseQuer ...