shareSDK分享 没有安装qq 微信的时候
2015-02-02 15:11
423 查看
在分享时,设备中没有安装应用的时候,提示没有安装。
#import <ShareSDK/ShareSDK.h>#import "WXApi.h"#import <TencentOpenAPI/QQApi.h>- (IBAction)docShare:(id)sender { NSArray *shareList = [ShareSDK getShareListWithType: ShareTypeWeixiSession, ShareTypeWeixiTimeline, ShareTypeQQ, nil]; //定义容器 id<ISSContainer> container = [ShareSDK container]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { [container setIPadContainerWithView:sender arrowDirect:UIPopoverArrowDirectionUp]; } else { [container setIPhoneContainerWithViewController:self]; } //定义分享内容 id<ISSContent> publishContent = nil; NSString *contentString =contentShare; NSString *titleString = titleShare; NSString *urlString = urlShare; NSString *description = summaryShare; NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"Icon@2x" ofType:@"png"]; publishContent = [ShareSDK content:contentString defaultContent:@"" image:[ShareSDK imageWithPath:imagePath] title:titleString url:urlString description:description mediaType:SSPublishContentMediaTypeNews]; //定义分享设置 id<ISSShareOptions> shareOptions = [ShareSDK simpleShareOptionsWithTitle:@"分享内容" shareViewDelegate:nil]; [ShareSDK showShareActionSheet:container shareList:shareList content:publishContent statusBarTips:NO authOptions:nil shareOptions:shareOptions result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {//返回事件 if (state == SSPublishContentStateSuccess) { NSLog(NSLocalizedString(@"TEXT_SHARE_SUC", @"分享成功!")); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"分享成功" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil,nil]; [alert show]; } else if (state == SSPublishContentStateFail) { if (type==24&&![QQApi isQQInstalled]) { //分享到QQ //没有安装qq NSLog(NSLocalizedString(@"TEXT_SHARE_FAI", @"没有安装QQ!"), [error errorCode], [error errorDescription]); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"没有安装QQ" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil,nil]; [alert show]; }else if ((type==22||type==23)&&![WXApi isWXAppInstalled]) { //没有安装qq || 没有安装微信 NSLog(NSLocalizedString(@"TEXT_SHARE_FAI", @"没有安装微信!"), [error errorCode], [error errorDescription]); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"没有安装微信" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil,nil]; [alert show]; }else { NSLog(NSLocalizedString(@"TEXT_SHARE_FAI", @"分享失败!"), [error errorCode], [error errorDescription]); NSLog(NSLocalizedString(@"TEXT_SHARE_SUC", @"分享成功!")); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"分享失败" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil,nil]; [alert show]; } } }];}
相关文章推荐
- shareSDK分享 没有安装qq 微信的时候
- iOS:判断设备上是否安装微信或qq 集成微信SDK的时候判断是否安装微信 基于ShareSDK
- ShareSdk OneKeyShare 点击界面变暗 但是没有分享菜单 以及 微信和qq分享的appkey问题
- ShareSDK社会化分享判断是否安装微信、QQ等客户端
- 使用ShareSDK完成第三方(QQ、微信、微博)登录和分享
- 分享到QQ成功后,没有回调成功,当再次分享的时候,失败回调执行了
- iOS9.0 微信、QQ分享提示未安装
- iOS项目开发实战——使用ShareSDK进行QQ和微信分享
- app分享时判断手机是否已安装微信或QQ客户端
- App在iOS9上不能分享至微信,提示微信没有安装
- ios使用友盟分享到QQ/微信时时如何判断手机上是否安装了QQ以及微信的客户端
- Android——分享文本给微博、微信、qq、邮箱、我的电脑等等手机上所安装的能够通信的软件
- 友盟分享打不开QQ,提示微信未安装,iOS应用开发
- App在iOS9上不能分享至微信,提示微信没有安装
- 使用ShareSDK完成第三方(QQ、微信、微博)登录和分享
- cordova 插件 调用iOS社交化分享(ShareSDK:微信QQ分享)
- iOS ShareSDK如果没有安装微信,QQ点击按钮没反应,上线有可能会被苹果拒绝.
- ShareSDK分享到微信、微信朋友圈、QQ
- iOS9 下ShareSDK分享到微信、QQ失效的解决办法
- 友盟社会化分享之判断是否安装了QQ、微信、新浪微博客户端