05.集成ShareSDK社会化分享组件
来源:互联网 发布:林书豪各赛季数据 编辑:程序博客网 时间:2024/05/07 03:37
在我的界面中,有个分享软件选项,点击它将会弹出如图所示分享界面。
接下来我们将演示如何将ShareSDK集成到我们的APP中。
1.首先,注册开发者帐号:http://www.mob.com/#/reg
2.下载ShareSDK:http://www.mob.com/#/downloadDetail/ShareSDK/ios
3.集成指南:http://wiki.mob.com/快速集成指南/
4.完成以后将会是这样:
在AppDelegate.m文件里:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[self initShareSDK];return YES;}/** * 初始化shareSDK */- (void)initShareSDK{ [ShareSDK registerApp:@"appKey"]; //添加新浪微博应用 [ShareSDK connectSinaWeiboWithAppKey:@"568898243" appSecret:@"38a4f8204cc784f81f9f0daaf31e02e3" redirectUri:@"http://www.sharesdk.cn"]; //微信登陆的时候需要初始化 [ShareSDK connectWeChatWithAppId:@"wx4868b35061f87885" appSecret:@"64020361b8ec4c99936c0e3999a9f249" wechatCls:[WXApi class]]; //添加QQ空间应用 注册网址 http://connect.qq.com/intro/login/ [ShareSDK connectQZoneWithAppKey:@"100371282" appSecret:@"aed9b0303e3ed1e27bae87c33761161d" qqApiInterfaceCls:[QQApiInterface class] tencentOAuthCls:[TencentOAuth class]]; //添加QQ应用 注册网址 http://mobile.qq.com/api/ [ShareSDK connectQQWithQZoneAppKey:@"100371282" qqApiInterfaceCls:[QQApiInterface class] tencentOAuthCls:[TencentOAuth class]];}到此,ShareSDK初始化完毕。接下来就是调用了:点击<分享软件>,调用该函数
- (void)shareApp{ NSArray *shareList = [ShareSDK getShareListWithType: ShareTypeSinaWeibo, ShareTypeWeixiSession, ShareTypeQQ, ShareTypeWeixiTimeline, ShareTypeWeixiFav, ShareTypeQQSpace,nil]; //构造分享内容 NSString *url = @"https://itunes.apple.com/cn/app/wu-liu-tang-shan/id990902550?mt=8"; id<ISSContent> publishContent = [ShareSDK content:url defaultContent:@"share" image:nil title:@"Share" url:url description:@"share" mediaType:SSPublishContentMediaTypeNews]; //创建弹出菜单容器 id<ISSContainer> container = [ShareSDK container]; [container setIPadContainerWithView:self.view arrowDirect:UIPopoverArrowDirectionUp]; //弹出分享菜单 [ShareSDK showShareActionSheet:container shareList:shareList content:publishContent statusBarTips:YES authOptions:nil shareOptions:nil result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) { if (state == SSResponseStateSuccess) { [MBProgressHUD showSuccess:@"分享成功"]; } else if (state == SSResponseStateFail) { NSString *msg = [NSString stringWithFormat:@"错误码:%ld,错误描述:%@", [error errorCode], [error errorDescription]]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"分享失败" message:msg delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; [alertView show]; }}];}
我们可以分享软件的App Store链接了。。。
0 0
- 05.集成ShareSDK社会化分享组件
- shareSDK社会化分享快速集成
- AndroidStudio集成ShareSDK社会化分享
- IOS集成ShareSDK社会化分享
- 社会化组件ShareSDK分享功能
- 通过shareSDK进行社会化分享集成
- ShareSDK移动APP社会化分享组件
- shareSDK移动APP社会化分享组件
- IOS友盟 社会化分享 > 社会化iOS组件 > 分享集成
- IOS友盟 社会化分享 > 社会化iOS组件 > 分享集成
- shareSDK社会化分享
- shareSDK社会化分享
- ShareSDK 社会化分享
- 第三方集成之社会化分享组件
- 集成友盟社会化分享组件
- 集成友盟分享-社会化组件
- 关于shareSDK做社会化分享
- android 社会化分享集成
- android 手机虚拟按键 震动过程的追溯(1)
- BestCoder Round #53 (div.2) C.Rikka with Graph II(dfs)
- Swift中的AnyObject和as
- 获取JVM的运行环境
- HDU 1394&& ZOJ 1484 求最小的逆序数 (线段树)
- 05.集成ShareSDK社会化分享组件
- Linux 文件夹说明
- CUDA GPU编程如何避免Bank conflict
- 统计单词个数
- 扫描二维码有什么用
- Linux命令学习笔记(4)----head命令、tail命令
- 第14周项目2 二叉树排序树中查找的路径
- Dialog 手动设置style
- C基本运算