iOS 自定义 shareSDK 容器
- (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 容器的更多相关文章
- iOS 自定义转场动画浅谈
代码地址如下:http://www.demodashi.com/demo/11612.html 路漫漫其修远兮,吾将上下而求索 前记 想研究自定义转场动画很久了,时间就像海绵,挤一挤还是有的,花了差不 ...
- 【iOS自定义键盘及键盘切换】详解
[iOS自定义键盘]详解 实现效果展示: 一.实现的协议方法代码 #import <UIKit/UIKit.h> //创建自定义键盘协议 @protocol XFG_KeyBoardDel ...
- 自定义Docker容器的 hostname
自定义Docker容器的 hostname 作者: John Deng 原创内容,欢迎传播,请注明出处:http://www.cnblogs.com/johnd/p/set-docker-host ...
- WPF中实现自定义虚拟容器(实现VirtualizingPanel)
WPF中实现自定义虚拟容器(实现VirtualizingPanel) 在WPF应用程序开发过程中,大数据量的数据展现通常都要考虑性能问题.有下面一种常见的情况:原始数据源数据量很大,但是某一时刻数据容 ...
- iOS自定义的UISwitch按钮
UISwitch开关控件 开关代替了点选框.开关是到目前为止用起来最简单的控件,不过仍然可以作一定程度的定制化. 一.创建 UISwitch* mySwitch = [[ UISwitchalloc] ...
- 如何实现 iOS 自定义状态栏
给大家介绍如何实现 iOS 自定义状态栏 Sample Code: 01 UIWindow * statusWindow = [[UIWindow alloc] initWithFrame:[UIAp ...
- iOS自定义组与组之间的距离以及视图
iOS自定义组与组之间的距离以及视图 //头视图高度 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(N ...
- iOS 自定义转场动画
代码地址如下:http://www.demodashi.com/demo/12955.html 一.总效果 本文记录分享下自定义转场动画的实现方法,具体到动画效果:新浪微博图集浏览转场效果.手势过渡动 ...
- iOS自定义转场动画实战讲解
iOS自定义转场动画实战讲解 转场动画这事,说简单也简单,可以通过presentViewController:animated:completion:和dismissViewControllerA ...
随机推荐
- MYSQL数据库重点:事务与锁机制
一.事务 一组连续的数据库操作,每一次操作都成功,整个事务就成功,只要有一步出错,整个事务就失败: MySQL事务与存储引擎相关 1.MyISAM:不支持事务,用于只读程序提高性能 2.InnoDB: ...
- Dependency Injection学习笔记
component把需要依赖者(CoffeeMaker)和供应提供者(Heater, Pump)联系起来 使用 区别:上的的依赖是内部创建的,下面的依赖是外面传进来的 注入方式
- 使用AndroidStudio dump heap,再用 Eclipse MAT插件分析内存泄露
1.eclipse mat插件的安装 Help->Install new software,如下图,一直下一步即可 2.AndroidStudio dump heap 3.AndroidStud ...
- 关于VBox安装GhostXP出现蓝屏processr.sys 的解决办法
用VirtualBox虚拟系统安装了一个Ghost XP SP3,还原系统后,重启进入Windows XP时,出现蓝屏提示processr.sys, 蓝屏代码为0x000000CE提示处理器驱动文件问 ...
- Compactness问题
今天偶然在论坛讨论在halcon下紧密度的问题,现在总结一下 Calculation: If L is the length of the contour (see contlength) and F ...
- C#下利用高精度计时器进行计时操作
简介 精确的时间计量方法在某些应用程序中是非常重要的.常用的 Windows API 方法 GetTickCount() 返回系统启动后经过的毫秒数.另一方面,GetTickCount() 函数仅有 ...
- magento目录结构精编版
1 /app – 程序根目录 2 3 /app/etc – 全局配置文件目录 4 5 /app/code – 所有模块安装其模型和控制器的目录 6 7 /app/code/core – 核心代码或经过 ...
- C# WinForm开发系列 - RDLC
http://www.cnblogs.com/peterzb/archive/2009/07/08/1519489.html http://jingyan.baidu.com/article/ab69 ...
- application与cache
每个项目都有一些全局,常用的信息,而这些信息如果在每次使用时都载入,那必将耗费很大的资源,特别是对访问压力大的系统.因此,这个情况中,把这些全局信息放到缓存中是很必要的,放在缓存中可以使得数据能够很快 ...
- Oracle 将不同列的值拼接成一个 字符串
利用拼接操作符“||”或者 CONCAT('','')函数,将不同列的值 拼接成一个 字符串 -- 方法一:推荐 SELECT S.TEAM ||'**'|| S.NAME ||'**'|| S. ...