ShareSDK 微博空间分享
来源:互联网 发布:js 函数 this 编辑:程序博客网 时间:2024/04/29 02:49
libz.1.2.5
-(void)initializePlat{
//添加新浪微博应用 (其他应用添加方法以此类推)
[ShareSDKconnectSinaWeiboWithAppKey:@"3201194191"appSecret:@"0334252914651e8f76bad63337b3b78f"redirectUri:@"http://appgo.cn"];
//添加腾讯微博应用
[ShareSDKconnectTencentWeiboWithAppKey:@"801307650"appSecret:@"ae36f4ee3946e1cbb98d6965b0b2ff5c"redirectUri:@"http://www.sharesdk.cn"];
//添加QQ空间应用
[ShareSDKconnectQZoneWithAppKey:@"100371282"
appSecret:@"aed9b0303e3ed1e27bae87c33761161d"];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions中添加以下代码
//注册SDK
[ShareSDKregisterApp:@"api20"];
[ShareSDKconvertUrlEnabled:YES];
[selfinitializePlat];
第三步:在一个viewController里面增加一个Button,点击Button开始微博空间分享功能@implementation ViewController
- (void)viewDidLoad
{
[superviewDidLoad];
UIButton *button = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
button.autoresizingMask =UIViewAutoresizingFlexibleRightMargin |UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth;
[button setTitle:@"分享全部" forState:UIControlStateNormal];
button.frame =CGRectMake(20,50,200, 45.0);
[button addTarget:selfaction:@selector(shareAllButtonClickHandler:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:button];
}
- (void)shareAllButtonClickHandler:(UIButton *)sender{
NSLog(@"菜单");
NSString *imagePath = [[NSBundlemainBundle]pathForResource:@"3"ofType:@"jpg"];
id<ISSContainer> container = [ShareSDKcontainer];
id<ISSContent> publishContent = [ShareSDKcontent:@"分享内容"
defaultContent:@"默认分享内容,没内容时显示"
image:[ShareSDKimageWithPath:imagePath]
title:@"ShareSDK"
url:@"http://www.sharesdk.cn"
description:@"这是一条测试信息"
mediaType:SSPublishContentMediaTypeNews]; //分享内容方式(可选择)
[ShareSDKshowShareActionSheet:container
shareList:nil
content:publishContent
statusBarTips:YES
authOptions:nil
shareOptions:nil
result:^(ShareType type,SSPublishContentState state,id<ISSStatusInfo> statusInfo,id<ICMErrorInfo> error,BOOL end) {
if (state == SSPublishContentStateSuccess)
{
NSLog(@"分享成功");
}
else if (state ==SSPublishContentStateFail)
{
NSLog(@"分享失败,错误码:%d,错误描述:%@", [error errorCode], [error errorDescription]);
}
}];
}
- ShareSDK 微博空间分享
- ShareSDK 微博空间分享
- ShareSDK 微博空间分享
- sharesdk QQ空间分享经验
- Android 分享设置 ShareSDK QQ空间 腾讯微博 新浪微博
- android shareSDK 微博分享案例
- iOS ShareSDK 分享到新浪微博
- shareSDK新浪微博分享的总结
- android shareSDK 微博分享案例
- iOS ShareSDK 分享到新浪微博
- sharesdk微信分享
- sharesdk微信分享
- sharesdk微信分享
- sharesdk分享qq空间-错误码1001
- work_weipa_使用shareSDK实现一键分享(QQ好友和空间、微信好友和朋友圈、新浪微博)
- unity3d利用sharesdk分享内容至微信、新浪微博、qq空间等国内主流社交平台(ios篇)
- unity3d利用sharesdk分享内容至微信、新浪微博、qq空间等国内主流社交平台(ios篇)
- 【ShareSDK社会化分享】新浪微博分享网络图片问题
- sqlServer表类型使用
- github入门
- Android and HTML5 开发手机应用
- svn 简介
- arcgis esri 学习资料网址大全
- ShareSDK 微博空间分享
- 第五章总结(下)
- 隧道技术GRE/PPTP/SSH等学习笔记
- Servlet线程安全问题
- webconfig 配置说明
- 【GitHub使用】常用技巧
- PAINTSTRUCT结构
- 稀疏图上的Johnson算法
- 简单的smtp发邮件类