- (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. Terrain & Light & Camera

    [Terrain Engine] 1.When you press F, wherever your mouse is positioned will be moved to the center o ...

  2. python知识点 2014-07-09

    迭代协议: 类实现方法__next__,则可以使用for.while来实现迭代 使用iter或者next实现手工迭代: L = [1,2,3] I = iter(L) print(I.next()) ...

  3. c语言中用宏定义一个常量,数字后面带个U, L, F的含义

    转: c语言中数字后面带个U是什么意思?#define F_CPU 12000000U答:U表示该常数用无符号整型方式存储,相当于unsigned int;L表示该常数用长整型方式存储,相当于long ...

  4. datareader几种用法总结

    1.本人常用: if (reader["字段名"] != DBNull.Value) { userRegisterInfo.OrgCode = reader["字段名&q ...

  5. HDU 5443 The Water Problem (水题,暴力)

    题意:给定 n 个数,然后有 q 个询问,问你每个区间的最大值. 析:数据很小,直接暴力即可,不会超时,也可以用RMQ算法. 代码如下: #include <cstdio> #includ ...

  6. Linux目录介绍

    /: 根目录,一般根目录下只存放目录,不要存放文件,/etc./bin./dev./lib./sbin应该和根目录放置在一个分区中/bin:/usr/bin: 可执行二进制文件的目录,如常用的命令ls ...

  7. Jmeter_初步认识随笔

    1. 简介 Apache JMeter是100%纯java桌面应用程序,被设计用来测试客户端/服务器结构的软件(例如web应用程序).它可以用来测试包括基于静态和动态资源程序的性能,例如静态文件,Ja ...

  8. 【Python实战02】共享Python代码到PyPI社区

    之前学习了Python的列表,以及编写了一个函数来进行列表的输出,这次我们就继续来学习如何把我们已经编写好的代码共享到PyPI社区,这里以上篇文章中编写的print_lol函数为例. 函数转换为模块 ...

  9. QT输入输出(一) 之 QDataStream 测试

    QT提供了两个高级别的流类---QDataStream和QTextStream,可以从任意的输入输出设备读取或写入数据. QDataStream用于读写二进制数据,它的优点是:在读写数据的时候已经严格 ...

  10. 移动端轮播图插件(支持Zepto和jQuery)

    一. 效果图 二. 功能介绍 1. 支持图片自动轮播和非自动轮播 2. 支持点击和滑动. 三. 简单介绍 代码都有注释,逻辑简单,不做更多赘述. 1. 在你的html中添加一行. <sectio ...