- (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. svn switch relocate用法

    svn info svn info 得到 Path: . Working Copy Root Path: /Users/chunhuizhao/phpworkspace/buptef_wxpay/tr ...

  2. 查询processlist具体信息

    SELECT * FROM information_schema.PROCESSLIST WHERE HOST LIKE '%172.16.10.22%' AND COMMAND <> ' ...

  3. Codeforces 27E. Number With The Given Amount Of Divisors (暴力)

    题目链接:http://codeforces.com/problemset/problem/27/E 暴力 //#pragma comment(linker, "/STACK:1024000 ...

  4. POJ3345

    http://poj.org/problem?id=3345 大意: 大意是说现在有n个城市来给你投票,你需要至少拿到m个城市的赞成票.想要获得第i个城市的赞成需要花费w[i],有个条件就是某些城市是 ...

  5. MAT(1) 小样

    一.内存溢出时生成hprof文件 运行参数: -Xms40m -Xmx40m -Xmn20m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=E:\J ...

  6. json操作json类型转换

    前提是需要加Jar包: gson-2.2.2.jar package utils; import java.io.BufferedReader;import java.io.FileInputStre ...

  7. Spring AOP 实现原理

    什么是AOP AOP(Aspect-OrientedProgramming,面向方面编程),可以说是OOP(Object-Oriented Programing,面向对象编程)的补充和完善.OOP引入 ...

  8. winForm开发

    http://www.cnblogs.com/wuhuacong/p/3199829.html http://www.cnblogs.com/peterzb/archive/2009/06/30/15 ...

  9. (剑指Offer)面试题35:第一个只出现一次的字符

    题目: 在字符串中找出第一个只出现1次的字符,如输入“abaccdeff”,则输出b. 思路: 1.暴力遍历 从头开始扫描字符串中的每个字符,当访问某个字符时,取该字符与后面的每个字符相比较,如果没有 ...

  10. Android与.Net交互模拟用户屏幕操作添加APN和网络4G/3G切换

    前几天接到一个需求,我们的客户需要对手机网络接入点进行可用性测试,简单点说就是需要实现Android上的APN配置的添加,APN切换网络模式4G/3G/2G切换,我要调研下写个demo. 因为是要实现 ...