Commit d59230b4686fcf865c556510948a198ab5ce62f7

Authored by 王军波
1 parent a5272947

no message

Showing 76 changed files with 4569 additions and 0 deletions

Too many changes to show.

To preserve performance only 76 of 83 files are displayed.

LiveVideoCloud/CNLiveShareSDK/Core/CNLiveEventHandlerDef.h 0 → 100644
  1 +//
  2 +// CNLiveEventHandlerDef.h
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/14.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +#import "CNLiveTypeDef.h"
  9 +#import "CNLiveUserInfoModel.h"
  10 +
  11 +#ifndef WSShareSDK_CNLiveEventHandlerDef_h
  12 +#define WSShareSDK_CNLiveEventHandlerDef_h
  13 +// 获取用户信息
  14 +typedef void(^GetUserInfoEventHandler) (BOOL result, CNLiveUserInfoModel *userInfo, NSString *error);
  15 +
  16 +// 退出登录
  17 +typedef void(^LogoutEventHandler)(BOOL result, NSString *error);
  18 +
  19 +// 分享
  20 +typedef void(^ShareResult)(BOOL result, CNErrorCode errorCode, NSString * errorMessage);
  21 +
  22 +#endif
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveQQ.h 0 → 100644
  1 +//
  2 +// CNLiveQQ.h
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/25.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <TencentOpenAPI/TencentOAuth.h>
  11 +#import <TencentOpenAPI/QQApiInterfaceObject.h>
  12 +#import <TencentOpenAPI/QQApiInterface.h>
  13 +#import "CNLiveEventHandlerDef.h"
  14 +#import "CNLiveShareModel.h"
  15 +#import "CNLiveTypeDef.h"
  16 +
  17 +@interface CNLiveQQ : NSObject<TencentSessionDelegate, TencentLoginDelegate>
  18 +
  19 +- (void)getQQUserInfoWithQId:(NSString *)QId result:(GetUserInfoEventHandler)result;
  20 +
  21 +- (void)shareContentWithShareType:(ShareType)shareType QId:(NSString *)QId shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result;
  22 +
  23 +- (void)logoutWithResult:(LogoutEventHandler)result;
  24 +
  25 +- (BOOL)isInstalledQQ;
  26 +
  27 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveQQ.m 0 → 100644
  1 +//
  2 +// CNLiveQQ.m
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/25.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import "CNLiveQQ.h"
  10 +#import "CNLiveShare.h"
  11 +#import "CNLiveTypeDef.h"
  12 +#import "NSDictionary+CNLiveSafeDictionary.h"
  13 +
  14 +@interface CNLiveQQ()
  15 +
  16 +@property (nonatomic, strong) TencentOAuth *tencentOAuth;
  17 +@property (nonatomic, copy)GetUserInfoEventHandler userInfoBlock;
  18 +@property (nonatomic, copy)LogoutEventHandler logoutBlock;
  19 +@property (nonatomic, copy)ShareResult shareResultBlock;
  20 +
  21 +@end
  22 +
  23 +@implementation CNLiveQQ
  24 +#pragma mark - getUserInfo
  25 +- (void)getQQUserInfoWithQId:(NSString *)QId result:(GetUserInfoEventHandler)result
  26 +{
  27 + self.tencentOAuth = [[TencentOAuth alloc] initWithAppId:QId andDelegate:self];
  28 +
  29 + NSArray *permissions = [NSArray arrayWithObjects:kOPEN_PERMISSION_GET_VIP_INFO, kOPEN_PERMISSION_GET_USER_INFO, kOPEN_PERMISSION_GET_SIMPLE_USER_INFO, nil];
  30 + [self.tencentOAuth authorize:permissions inSafari:NO];
  31 +
  32 + self.userInfoBlock = result;
  33 +}
  34 +
  35 +#pragma mark - shareContent
  36 +- (void)shareContentWithShareType:(ShareType)shareType QId:(NSString *)QId shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result
  37 +{
  38 + self.shareResultBlock = result;
  39 + self.tencentOAuth = [[TencentOAuth alloc] initWithAppId:QId andDelegate:self];
  40 +
  41 + NSURL *url = nil;
  42 + if (shareModel.url) {
  43 + url = [NSURL URLWithString:shareModel.url];
  44 + }
  45 + QQApiNewsObject *newsObj = [QQApiNewsObject objectWithURL:url title:shareModel.title description:shareModel.descriptions previewImageURL:[NSURL URLWithString:shareModel.imageURL]];
  46 +
  47 + SendMessageToQQReq *req = [SendMessageToQQReq reqWithContent:newsObj];
  48 +
  49 + switch (shareType) {
  50 + case ShareTypeQQSession:
  51 + {
  52 + //将内容分享到qq
  53 + [self QQSendResultWithResultCode:[QQApiInterface sendReq:req]];
  54 + }
  55 + break;
  56 +
  57 + case ShareTypeQQZone:
  58 + {
  59 + //将内容分享到qzone
  60 + [self QQSendResultWithResultCode:[QQApiInterface SendReqToQZone:req]];
  61 + }
  62 + break;
  63 +
  64 + default:
  65 + break;
  66 + }
  67 +
  68 +
  69 +}
  70 +
  71 +// QQDelegate
  72 +- (void)onResp:(QQBaseResp *)resp
  73 +{
  74 + switch (resp.type)
  75 + {
  76 + case ESENDMESSAGETOQQRESPTYPE:
  77 + {
  78 + if ([resp.result isEqualToString:@"0"]) {
  79 + self.shareResultBlock(YES, QQAPISENDSUCESS, @"分享成功");
  80 + }
  81 + else if ([resp.result isEqualToString:@"-4"]) {
  82 + self.shareResultBlock(NO, QQErrCodeUserCancel, @"用户取消授权");
  83 + }
  84 + break;
  85 + }
  86 + default:
  87 + {
  88 + self.shareResultBlock(NO, UnknowErrorCode, @"未知错误信息");
  89 + break;
  90 + }
  91 + }
  92 +}
  93 +
  94 +- (void)QQSendResultWithResultCode:(QQApiSendResultCode)resultCode
  95 +{
  96 + switch (resultCode) {
  97 + case EQQAPISENDSUCESS:
  98 + {
  99 +// self.shareResultBlock(YES, QQAPISENDSUCESS, @"分享成功");
  100 + }
  101 + break;
  102 + case EQQAPIQQNOTINSTALLED:
  103 + {
  104 + self.shareResultBlock(NO, QQAPIQQNOTINSTALLED, @"手机QQ未安装");
  105 + }
  106 + break;
  107 + case EQQAPIQQNOTSUPPORTAPI:
  108 + {
  109 + self.shareResultBlock(NO, QQAPIQQNOTSUPPORTAPI, @"不支持API");
  110 + }
  111 + break;
  112 + case EQQAPIMESSAGETYPEINVALID:
  113 + {
  114 + self.shareResultBlock(NO, QQAPIMESSAGETYPEINVALID, @"消息类型无效");
  115 + }
  116 + break;
  117 + case EQQAPIMESSAGECONTENTNULL:
  118 + {
  119 + self.shareResultBlock(NO, QQAPIMESSAGECONTENTNULL, @"消息内容为空");
  120 + }
  121 + break;
  122 + case EQQAPIMESSAGECONTENTINVALID:
  123 + {
  124 + self.shareResultBlock(NO, QQAPIMESSAGECONTENTINVALID, @"消息内容无效");
  125 + }
  126 + break;
  127 + case EQQAPIAPPNOTREGISTED:
  128 + {
  129 + self.shareResultBlock(NO, QQAPIAPPNOTREGISTED, @"APP未注册");
  130 + }
  131 + break;
  132 + case EQQAPIAPPSHAREASYNC:
  133 + {
  134 +// self.shareResultBlock(NO, QQAPIAPPSHAREASYNC, @"异步分享");
  135 + }
  136 + break;
  137 + case EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW:
  138 + {
  139 + self.shareResultBlock(NO, QQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW, @"QQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW");
  140 + }
  141 + break;
  142 + case EQQAPISENDFAILD:
  143 + {
  144 + self.shareResultBlock(NO, QQAPISENDFAILD, @"发送失败");
  145 + }
  146 + break;
  147 + case EQQAPIQZONENOTSUPPORTTEXT:
  148 + {
  149 + self.shareResultBlock(NO, QQAPIQZONENOTSUPPORTTEXT, @"qzone分享不支持text类型分享");
  150 + }
  151 + break;
  152 + case EQQAPIQZONENOTSUPPORTIMAGE:
  153 + {
  154 + self.shareResultBlock(NO, QQAPIQZONENOTSUPPORTIMAGE, @"qzone分享不支持image类型分享");
  155 + }
  156 + break;
  157 +
  158 + default:
  159 + break;
  160 + }
  161 +}
  162 +
  163 +#pragma mark - logout
  164 +- (void)logoutWithResult:(LogoutEventHandler)result
  165 +{
  166 + if (result) {
  167 + [self.tencentOAuth logout:self];
  168 + self.logoutBlock = result;
  169 + }
  170 +}
  171 +
  172 +#pragma mark - TencentLoginDelegate
  173 +//登录成功后的回调
  174 +- (void)tencentDidLogin
  175 +{
  176 + [self.tencentOAuth getUserInfo];
  177 +}
  178 +
  179 +//登录失败后的回调
  180 +//cancelled 代表用户是否主动退出登录
  181 +- (void)tencentDidNotLogin:(BOOL)cancelled
  182 +{
  183 + if (cancelled){
  184 +
  185 + self.userInfoBlock(NO, nil, @"用户取消");
  186 +
  187 + }else{
  188 +
  189 + self.userInfoBlock(NO, nil, @"登录失败");
  190 +
  191 + }
  192 +}
  193 +//登录时网络有问题的回调
  194 +- (void)tencentDidNotNetWork
  195 +{
  196 + self.userInfoBlock(NO, nil, @"网络有问题");
  197 +}
  198 +
  199 +#pragma mark - TencentSessionDelegate
  200 +- (void)getUserInfoResponse:(APIResponse *)response
  201 +{
  202 + /* int _detailRetCode;
  203 + int _retCode;
  204 + int _seq;
  205 + NSString *_errorMsg;
  206 + NSDictionary *_jsonResponse;
  207 + NSString *_message;
  208 + id _userData;
  209 + */
  210 +
  211 + if (response.retCode) {
  212 + // 网络请求是否成功送达服务器,以及服务器返回的数据格式是否正确
  213 + self.userInfoBlock(NO, nil, @"网络有问题");
  214 + }
  215 + else if (response.errorMsg != nil) {
  216 +
  217 + self.userInfoBlock(NO, nil, response.errorMsg);
  218 + }
  219 + else if (response.jsonResponse) {
  220 +
  221 + NSDictionary *jsonResponseDic = [response.jsonResponse safeDictionary];
  222 +
  223 + CNLiveUserInfoModel *model = [[CNLiveUserInfoModel alloc] init];
  224 + model.originaInformation = jsonResponseDic;
  225 + model.nickName = [jsonResponseDic objectForKey:@"nickname"];
  226 + model.province = [jsonResponseDic objectForKey:@"province"];
  227 + model.imageUrl = [jsonResponseDic objectForKey:@"figureurl_qq_2"];
  228 + model.uid = [self.tencentOAuth getUserOpenID];
  229 + model.city = [jsonResponseDic objectForKey:@"city"];
  230 + if (model.city == nil || model.city.length == 0) {
  231 + model.city = @"空";
  232 + }
  233 + NSString *gender = [jsonResponseDic objectForKey:@"gender"];
  234 + if ([gender isEqualToString:@"男"]) {
  235 + model.gender = @"m";
  236 + }
  237 + else if ([gender isEqualToString:@"女"]) {
  238 + model.gender = @"f";
  239 + }
  240 + else {
  241 + model.gender = @"n";
  242 + }
  243 + self.userInfoBlock(YES, model, @"");
  244 + }
  245 +
  246 +}
  247 +
  248 +#pragma mark - tencentDidLogout
  249 +- (void)tencentDidLogout
  250 +{
  251 + self.logoutBlock(YES, @"");
  252 +}
  253 +
  254 +#pragma mark - isInstalledQQ
  255 +- (BOOL)isInstalledQQ
  256 +{
  257 + return [QQApiInterface isQQInstalled];
  258 +}
  259 +
  260 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveShare.h 0 → 100644
  1 +//
  2 +// CNLiveShare.h
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/13.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <UIKit/UIKit.h>
  11 +#import "CNLiveTypeDef.h"
  12 +#import "CNLiveEventHandlerDef.h"
  13 +#import "CNLiveShareModel.h"
  14 +
  15 +@interface CNLiveShare : NSObject
  16 +
  17 ++ (CNLiveShare *)manager;
  18 +
  19 +/**
  20 + * @brief 用于CNLiveShareModel类中imageData属性
  21 + */
  22 ++ (UIImage *)getImageWithImageUrl:(NSString *)imageUrl;
  23 +
  24 ++ (NSData *)pngImageWithImage:(UIImage *)image;
  25 +
  26 ++ (NSData *)jpegImageWithImage:(UIImage *)image quality:(CGFloat)quality;
  27 +
  28 +/**
  29 + * @brief 处理请求打开链接,如果集成新浪微博(SSO)、微信、QQ分享功能需要加入此方法
  30 + *
  31 + * @param url 链接
  32 + *
  33 + * @return YES 表示接受请求 NO 表示不接受
  34 + */
  35 ++ (BOOL)handleOpenURL:(NSURL *)url;
  36 +
  37 +/**
  38 + * @brief 注册App
  39 + *
  40 + * @param appType 分享平台
  41 + * @param appID 从分享平台获取的appID
  42 + * @param appSecret 从分享平台获取的appSecret
  43 + * @param redirectURI 新浪微博开放平台第三方应用授权回调页地址,其他平台为空
  44 + * @warning redirectURI 必须保证和在新浪微博开放平台应用管理界面配置的“授权回调页”地址一致,如未进行配置则默认为`http://`
  45 + * @warning redirectURI 当AppType为SinaType时不能为空,长度小于1K
  46 + *
  47 + */
  48 ++ (void)registAppWithAppType:(AppType)appType appID:(NSString *)appID appSecret:(NSString *)appSecret redirectURI:(NSString *)uri;
  49 +
  50 +/**
  51 + * @brief 获取用户信息
  52 + *
  53 + * @param appType 分享平台
  54 + * @param userInfo 用于返回用户信息的Block
  55 + *
  56 + */
  57 ++ (void)getUserInfoWithType:(AppType)appType result:(GetUserInfoEventHandler)userInfo;
  58 +
  59 +/**
  60 + * @brief 分享内容到指定平台
  61 + *
  62 + * @param appType 分享平台
  63 + * @param shareModel 分享的内容的模型
  64 + *
  65 + */
  66 ++ (void)shareContentWithShareType:(ShareType)shareType shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result;
  67 +
  68 +/**
  69 + * @brief 退出登录
  70 + *
  71 + * @param appType 分享平台
  72 + * @param result 用于返回退出状态的Block
  73 + *
  74 + */
  75 ++ (void)logoutWithAPPType:(AppType)appType result:(LogoutEventHandler)result;
  76 +
  77 +/**
  78 + * @brief 判断用户是否安装相应App
  79 + *
  80 + * @param appType 分享平台
  81 + *
  82 + * @return YES 表示已安装 NO 表示未安装
  83 + */
  84 ++ (BOOL)isInstalledWithAppType:(AppType)appType;
  85 +
  86 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveShare.m 0 → 100644
  1 +//
  2 +// CNLiveShare.m
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/13.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import "CNLiveShare.h"
  10 +// WeChat
  11 +#import "WXApi.h"
  12 +#import "CNLiveWeChat.h"
  13 +// QQ
  14 +#import <TencentOpenAPI/TencentOAuth.h>
  15 +#import <TencentOpenAPI/QQApiInterfaceObject.h>
  16 +#import <TencentOpenAPI/QQApiInterface.h>
  17 +#import "CNLiveQQ.h"
  18 +// Sina
  19 +#import "WeiboSDK.h"
  20 +#import "CNLiveSina.h"
  21 +
  22 +//第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传,state字符串长度不能超过1K
  23 +#define verificationCode @"cnlive"
  24 +
  25 +@interface CNLiveShare()
  26 +
  27 +// WeChat
  28 +@property (nonatomic, copy) NSString *WXId;
  29 +@property (nonatomic, copy) NSString *WXSecret;
  30 +@property (nonatomic, strong) CNLiveWeChat *weChat;
  31 +
  32 +// QQ
  33 +@property (nonatomic, copy) NSString *QId;
  34 +@property (nonatomic, copy) NSString *QSecret;
  35 +@property (nonatomic, strong) CNLiveQQ *QQ;
  36 +
  37 +// Sina
  38 +@property (nonatomic, copy) NSString *SId;
  39 +@property (nonatomic, copy) NSString *SSecret;
  40 +@property (nonatomic, strong) CNLiveSina *sina;
  41 +@property (nonatomic, copy) NSString *redirectURI;
  42 +
  43 +@end
  44 +@implementation CNLiveShare
  45 +
  46 ++ (CNLiveShare *)manager
  47 +{
  48 + static CNLiveShare *share = nil;
  49 +
  50 + static dispatch_once_t predicate;
  51 +
  52 + dispatch_once(&predicate, ^{
  53 +
  54 + share = [[self alloc] init];
  55 + share.weChat = [[CNLiveWeChat alloc] init];
  56 + share.QQ = [[CNLiveQQ alloc] init];
  57 + share.sina = [[CNLiveSina alloc] init];
  58 + });
  59 +
  60 + return share;
  61 +}
  62 +
  63 ++ (BOOL)handleOpenURL:(NSURL *)url
  64 +{
  65 + if ([url.scheme isEqualToString:[CNLiveShare manager].WXId]) {
  66 +
  67 + return [WXApi handleOpenURL:url delegate:[CNLiveShare manager].weChat];
  68 + }
  69 + else if ([url.scheme isEqualToString:[NSString stringWithFormat:@"tencent%@", [CNLiveShare manager].QId]]) {
  70 +
  71 + [TencentOAuth HandleOpenURL:url];
  72 + return [QQApiInterface handleOpenURL:url delegate:(id)[CNLiveShare manager].QQ];
  73 +
  74 + }
  75 + else if ([url.scheme isEqualToString:[NSString stringWithFormat:@"wb%@", [CNLiveShare manager].SId]]) {
  76 +
  77 + return [WeiboSDK handleOpenURL:url delegate:[CNLiveShare manager].sina];
  78 + }
  79 + else {
  80 + return YES;
  81 + }
  82 +}
  83 +
  84 ++ (void)registAppWithAppType:(AppType)appType appID:(NSString *)appID appSecret:(NSString *)appSecret redirectURI:(NSString *)uri
  85 +{
  86 + switch (appType) {
  87 + case WeChatType:
  88 + {
  89 + [WXApi registerApp:appID];
  90 + [CNLiveShare manager].WXId = appID;
  91 + [CNLiveShare manager].WXSecret = appSecret;
  92 + }
  93 + break;
  94 +
  95 + case QQType:
  96 + {
  97 + [CNLiveShare manager].QId = appID;
  98 + [CNLiveShare manager].QSecret = appSecret;
  99 + }
  100 + break;
  101 +
  102 + case SinaType:
  103 + {
  104 + [WeiboSDK registerApp:appID];
  105 + [CNLiveShare manager].SId = appID;
  106 + [CNLiveShare manager].SSecret = appSecret;
  107 + [CNLiveShare manager].redirectURI = uri;
  108 + }
  109 + break;
  110 + default:
  111 + break;
  112 + }
  113 +}
  114 +
  115 ++ (void)getUserInfoWithType:(AppType)appType result:(GetUserInfoEventHandler)userInfo
  116 +{
  117 + switch (appType) {
  118 + case WeChatType:
  119 + {
  120 + [[CNLiveShare manager].weChat getWeChatUserInfoWithAppId:[CNLiveShare manager].WXId AppSecret:[CNLiveShare manager].WXSecret userInfo:userInfo];
  121 + }
  122 + break;
  123 +
  124 + case QQType:
  125 + {
  126 + [[CNLiveShare manager].QQ getQQUserInfoWithQId:[CNLiveShare manager].QId result:userInfo];
  127 + }
  128 + break;
  129 +
  130 + case SinaType:
  131 + {
  132 + [[CNLiveShare manager].sina getSinaUserInfoWithRedirectURI:[CNLiveShare manager].redirectURI SId:[CNLiveShare manager].SId result:userInfo];
  133 + }
  134 + break;
  135 +
  136 + default:
  137 + break;
  138 + }
  139 +}
  140 +
  141 ++ (void)shareContentWithShareType:(ShareType)shareType shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result
  142 +{
  143 + switch (shareType) {
  144 + case ShareTypeWeChatSession:
  145 + {
  146 + [[CNLiveShare manager].weChat shareContentWithShareType:ShareTypeWeChatSession shareModel:shareModel shareResult:result];
  147 + }
  148 + break;
  149 + case ShareTypeWeChatTimeline:
  150 + {
  151 + [[CNLiveShare manager].weChat shareContentWithShareType:ShareTypeWeChatTimeline shareModel:shareModel shareResult:result];
  152 + }
  153 + break;
  154 + case ShareTypeWeChatFav:
  155 + {
  156 + [[CNLiveShare manager].weChat shareContentWithShareType:ShareTypeWeChatFav shareModel:shareModel shareResult:result];
  157 + }
  158 + break;
  159 + case ShareTypeQQSession:
  160 + {
  161 + [[CNLiveShare manager].QQ shareContentWithShareType:ShareTypeQQSession QId:[CNLiveShare manager].QId shareModel:shareModel shareResult:result];
  162 + }
  163 + break;
  164 + case ShareTypeQQZone:
  165 + {
  166 + [[CNLiveShare manager].QQ shareContentWithShareType:ShareTypeQQZone QId:[CNLiveShare manager].QId shareModel:shareModel shareResult:result];
  167 + }
  168 + break;
  169 + case ShareTypeSina:
  170 + {
  171 + [[CNLiveShare manager].sina shareContentWithRedirectURI:[CNLiveShare manager].redirectURI shareModel:shareModel shareResult:result];
  172 + }
  173 + break;
  174 +
  175 + default:
  176 + break;
  177 + }
  178 +}
  179 ++ (void)logoutWithAPPType:(AppType)appType result:(LogoutEventHandler)result
  180 +{
  181 + switch (appType) {
  182 + case WeChatType:
  183 + {
  184 + [[CNLiveShare manager].weChat logoutWithResult:result];
  185 + }
  186 + break;
  187 + case QQType:
  188 + {
  189 + [[CNLiveShare manager].QQ logoutWithResult:result];
  190 + }
  191 + break;
  192 + case SinaType:
  193 + {
  194 + [[CNLiveShare manager].sina logoutWithResult:result];
  195 + }
  196 + break;
  197 +
  198 + default:
  199 + break;
  200 + }
  201 +}
  202 +
  203 ++ (BOOL)isInstalledWithAppType:(AppType)appType
  204 +{
  205 + switch (appType) {
  206 + case WeChatType:
  207 + {
  208 + return [[CNLiveShare manager].weChat isInstalledWeChat];
  209 + }
  210 + break;
  211 + case QQType:
  212 + {
  213 + return [[CNLiveShare manager].QQ isInstalledQQ];
  214 + }
  215 + break;
  216 + case SinaType:
  217 + {
  218 + return [[CNLiveShare manager].sina isInstalledSina];
  219 + }
  220 + break;
  221 +
  222 + default:
  223 + break;
  224 + }
  225 +}
  226 +
  227 ++ (UIImage *)getImageWithImageUrl:(NSString *)imageUrl
  228 +{
  229 + if (!imageUrl || ![imageUrl isKindOfClass:[NSString class]]) {
  230 + return nil;
  231 + }
  232 + NSData * data = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageUrl]];
  233 + return [UIImage imageWithData:data];
  234 +}
  235 +
  236 ++ (NSData *)pngImageWithImage:(UIImage *)image
  237 +{
  238 + return UIImagePNGRepresentation(image);
  239 +}
  240 +
  241 ++ (NSData *)jpegImageWithImage:(UIImage *)image quality:(CGFloat)quality
  242 +{
  243 + return UIImageJPEGRepresentation(image, quality);
  244 +}
  245 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveShareModel.h 0 → 100644
  1 +//
  2 +// CNLiveShareModel.h
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/26.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +@interface CNLiveShareModel : NSObject
  12 +
  13 +@property (nonatomic, copy) NSString *title;
  14 +@property (nonatomic, copy) NSString *descriptions;
  15 +@property (nonatomic, copy) NSString *imageURL;
  16 +@property (nonatomic, copy) NSString *url;
  17 +/**
  18 + Sina专用,对象唯一ID,用于唯一标识一个多媒体内容
  19 +
  20 + 当第三方应用分享多媒体内容到微博时,应该将此参数设置为被分享的内容在自己的系统中的唯一标识
  21 + @warning 不能为空,长度小于255
  22 + */
  23 +@property (nonatomic, copy) NSString *objectID;
  24 +
  25 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveShareModel.m 0 → 100644
  1 +//
  2 +// CNLiveShareModel.m
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/26.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import "CNLiveShareModel.h"
  10 +
  11 +@implementation CNLiveShareModel
  12 +
  13 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveSina.h 0 → 100644
  1 +//
  2 +// CNLiveSina.h
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/26.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "WeiboSDK.h"
  11 +#import "CNLiveEventHandlerDef.h"
  12 +#import "CNLiveShareModel.h"
  13 +
  14 +@interface CNLiveSina : NSObject<WeiboSDKDelegate>
  15 +
  16 +- (void)getSinaUserInfoWithRedirectURI:(NSString *)uri SId:(NSString *)sid result:(GetUserInfoEventHandler)result;
  17 +
  18 +- (void)shareContentWithRedirectURI:(NSString *)uri shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result;
  19 +
  20 +- (void)logoutWithResult:(LogoutEventHandler)result;
  21 +
  22 +- (BOOL)isInstalledSina;
  23 +
  24 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveSina.m 0 → 100644
  1 +//
  2 +// CNLiveSina.m
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/26.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import "CNLiveSina.h"
  10 +#import "CNLiveEventHandlerDef.h"
  11 +#import "CNLiveUserInfoModel.h"
  12 +#import "NSDictionary+CNLiveSafeDictionary.h"
  13 +
  14 +@interface CNLiveSina()<WBHttpRequestDelegate>
  15 +
  16 +@property (nonatomic, copy)GetUserInfoEventHandler userInfoBlock;
  17 +@property (nonatomic, copy)LogoutEventHandler logoutBlock;
  18 +@property (nonatomic, copy)ShareResult shareResultBlock;
  19 +@property (nonatomic, copy)NSString *SId;
  20 +@property (nonatomic, copy)NSString *SSecret;
  21 +@property (nonatomic, copy)NSString *accessToken;
  22 +
  23 +@end
  24 +
  25 +@implementation CNLiveSina
  26 +
  27 +#pragma mark - getUserInfo
  28 +- (void)getSinaUserInfoWithRedirectURI:(NSString *)uri SId:(NSString *)sid result:(GetUserInfoEventHandler)result
  29 +{
  30 + [WeiboSDK enableDebugMode:YES];
  31 + self.userInfoBlock = result;
  32 + self.SId = sid;
  33 + WBAuthorizeRequest *request = [WBAuthorizeRequest request];
  34 + request.redirectURI = uri;
  35 + request.scope = @"all";
  36 +// request.userInfo = @{@"SSO_From": @"SendMessageToWeiboViewController",
  37 +// @"Other_Info_1": [NSNumber numberWithInt:123],
  38 +// @"Other_Info_2": @[@"obj1", @"obj2"],
  39 +// @"Other_Info_3": @{@"key1": @"obj1", @"key2": @"obj2"}};
  40 + [WeiboSDK sendRequest:request];
  41 +}
  42 +
  43 +#pragma mark - shareToSina
  44 +- (void)shareContentWithRedirectURI:(NSString *)uri shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result
  45 +{
  46 + self.shareResultBlock = result;
  47 + WBAuthorizeRequest *authRequest = [WBAuthorizeRequest request];
  48 + authRequest.redirectURI = uri;
  49 + authRequest.scope = @"all";
  50 +
  51 + WBMessageObject *message = [WBMessageObject message];
  52 + WBImageObject *image = [WBImageObject object];
  53 + image.imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:shareModel.imageURL]];
  54 + message.imageObject = image;
  55 + message.text = shareModel.title;
  56 +
  57 +// WBWebpageObject *webpage = [WBWebpageObject object];
  58 +// webpage.objectID = shareModel.objectID;
  59 +// webpage.title = shareModel.title;
  60 +// webpage.description = shareModel.descriptions;
  61 +// webpage.thumbnailData = shareModel.imageData;
  62 +// webpage.webpageUrl = @"";
  63 +// message.mediaObject = webpage;
  64 +
  65 + WBSendMessageToWeiboRequest *request = [WBSendMessageToWeiboRequest requestWithMessage:message authInfo:authRequest access_token:self.accessToken];
  66 +// request.shouldOpenWeiboAppInstallPageIfNotInstalled = NO;
  67 + [WeiboSDK sendRequest:request];
  68 +
  69 +}
  70 +
  71 +#pragma mark - logout
  72 +- (void)logoutWithResult:(LogoutEventHandler)result
  73 +{
  74 + if (result) {
  75 + self.logoutBlock = result;
  76 + [WeiboSDK logOutWithToken:self.accessToken delegate:self withTag:@"logout"];
  77 + }
  78 +}
  79 +
  80 +#pragma mark - isInstalledSina
  81 +- (BOOL)isInstalledSina
  82 +{
  83 + return [WeiboSDK isWeiboAppInstalled];
  84 +}
  85 +
  86 +#pragma mark - WeiboSDKDelegate
  87 +- (void)didReceiveWeiboRequest:(WBBaseRequest *)request
  88 +{
  89 +
  90 +}
  91 +
  92 +- (void)didReceiveWeiboResponse:(WBBaseResponse *)response
  93 +{
  94 + if ([response isKindOfClass:WBAuthorizeResponse.class])
  95 + {
  96 + self.accessToken = [response.userInfo objectForKey:@"access_token"];
  97 + [self getUserInfoWithUId:[response.userInfo objectForKey:@"uid"] accessToken:[response.userInfo objectForKey:@"access_token"]];
  98 + }
  99 + if ([response isKindOfClass:WBSendMessageToWeiboResponse.class])
  100 + {
  101 + [self SinaResponseStatus:response];
  102 + }
  103 +}
  104 +
  105 +- (void)getUserInfoWithUId:(NSString *)uid accessToken:(NSString *)token
  106 +{
  107 + NSString *urlStr = [NSString stringWithFormat:@"https://api.weibo.com/2/users/show.json?uid=%@&access_token=%@&source=%@", uid, token, self.SId];
  108 + [WBHttpRequest requestWithURL:urlStr httpMethod:@"GET" params:nil delegate:self withTag:@"userinfo"];
  109 +
  110 +}
  111 +
  112 +- (void)SinaResponseStatus:(WBBaseResponse *)response
  113 +{
  114 + switch (response.statusCode) {
  115 + // 成功
  116 + case WeiboSDKResponseStatusCodeSuccess:
  117 + {
  118 + self.shareResultBlock(YES, SinaSuccess, @"分享成功");
  119 + }
  120 + break;
  121 + // 用户取消发送
  122 + case WeiboSDKResponseStatusCodeUserCancel:
  123 + {
  124 + self.shareResultBlock(NO, SinaUserCancel, @"用户取消发送");
  125 + }
  126 + break;
  127 + // 发送失败
  128 + case WeiboSDKResponseStatusCodeSentFail:
  129 + {
  130 + self.shareResultBlock(NO, SinaSentFail, @"发送失败");
  131 + }
  132 + break;
  133 + // 授权失败
  134 + case WeiboSDKResponseStatusCodeAuthDeny:
  135 + {
  136 + self.shareResultBlock(NO, SinaAuthDeny, @"授权失败");
  137 + }
  138 + break;
  139 + // 用户取消安装微博客户端
  140 + case WeiboSDKResponseStatusCodeUserCancelInstall:
  141 + {
  142 + self.shareResultBlock(NO, SinaUserCancelInstall, @"用户取消安装微博客户端");
  143 + }
  144 + break;
  145 + // 分享失败
  146 + case WeiboSDKResponseStatusCodeShareInSDKFailed:
  147 + {
  148 + self.shareResultBlock(NO, SinaShareInSDKFailed, @"分享失败");
  149 + }
  150 + break;
  151 + // 不支持的请求
  152 + case WeiboSDKResponseStatusCodeUnsupport:
  153 + {
  154 + self.shareResultBlock(NO, SinaUnsupport, @"不支持的请求");
  155 + }
  156 + break;
  157 +
  158 + default:
  159 + break;
  160 + }
  161 +}
  162 +
  163 +#pragma mark - WBHttpRequestDelegate
  164 +- (void)request:(WBHttpRequest *)request didFinishLoadingWithDataResult:(NSData *)data
  165 +{
  166 + if ([request.tag isEqualToString:@"userinfo"]) {
  167 + NSDictionary *dic = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] safeDictionary];
  168 + CNLiveUserInfoModel *model = [[CNLiveUserInfoModel alloc] init];
  169 + model.originaInformation = dic;
  170 + model.nickName = [dic objectForKey:@"name"];
  171 + model.imageUrl = [dic objectForKey:@"avatar_hd"];
  172 + model.uid = [dic objectForKey:@"id"];
  173 + model.language = [dic objectForKey:@"lang"];
  174 + model.province = [dic objectForKey:@"location"];
  175 + if (model.province == nil || model.province.length == 0) {
  176 + model.province = @"空";
  177 + }
  178 + model.city = [dic objectForKey:@"location"];
  179 + if (model.city == nil || model.city.length == 0) {
  180 + model.city = @"空";
  181 + }
  182 +
  183 + if ([[dic objectForKey:@"gender"] isEqualToString:@"m"]) {
  184 + model.gender = @"m";
  185 + }
  186 + else if ([[dic objectForKey:@"gender"] isEqualToString:@"f"]) {
  187 + model.gender = @"f";
  188 + }
  189 + else {
  190 + model.gender = @"n";
  191 + }
  192 + if (self.userInfoBlock) {
  193 + self.userInfoBlock(YES, model, @"");
  194 + }
  195 + }
  196 + else if ([request.tag isEqualToString:@"logout"]) {
  197 +
  198 + self.logoutBlock(YES, @"");
  199 + }
  200 +}
  201 +
  202 +- (void)request:(WBHttpRequest *)request didFailWithError:(NSError *)error
  203 +{
  204 + if ([request.tag isEqualToString:@"userinfo"]) {
  205 +
  206 + self.userInfoBlock(NO, nil, error.localizedFailureReason);
  207 + }
  208 + else if ([request.tag isEqualToString:@"logout"]) {
  209 +
  210 + self.logoutBlock(NO, error.localizedFailureReason);
  211 + }
  212 +}
  213 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveTypeDef.h 0 → 100644
  1 +//
  2 +// CNLiveTypeDef.h
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/14.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#ifndef WSShareSDK_CNLiveTypeDef_h
  10 +#define WSShareSDK_CNLiveTypeDef_h
  11 +
  12 +typedef enum {
  13 +
  14 + WeChatType = 1,
  15 + QQType = 2,
  16 + SinaType = 3
  17 +
  18 +}AppType;
  19 +
  20 +typedef enum {
  21 +
  22 + ShareTypeWeChatSession = 0, // 微信好友
  23 + ShareTypeWeChatTimeline = 1, // 微信朋友圈
  24 + ShareTypeWeChatFav = 2, // 微信收藏
  25 +
  26 + ShareTypeQQSession = 3, // QQ好友
  27 + ShareTypeQQZone = 4, // QQ空间
  28 +
  29 + ShareTypeSina = 5 // Sina
  30 +
  31 +}ShareType;
  32 +
  33 +typedef enum {
  34 + WeChatSuccess = 0, // 成功
  35 + WeChatErrCodeCommon = -1, // 普通错误类型
  36 + WeChatErrCodeUserCancel = -2, // 用户点击取消并返回
  37 + WeChatErrCodeSentFail = -3, // 发送失败
  38 + WeChatErrCodeAuthDeny = -4, // 授权失败
  39 + WeChatErrCodeUnsupport = -5, // 微信不支持
  40 +
  41 + QQSuccess = 1, // 成功
  42 + QQErrCodeUserCancel = 2, // 用户点击取消并返回
  43 + QQErrCodeSentFail = 3, // 发送失败
  44 + QQErrCodeAuthDeny = 4, // 授权失败
  45 + QQErrCodeNetworkFault = 5, // 网络问题导致登录失败
  46 +
  47 + QQAPISENDSUCESS = 6, // 分享成功
  48 + QQAPIQQNOTINSTALLED = 7, // 手机QQ未安装
  49 + QQAPIQQNOTSUPPORTAPI = 8, // 不支持API
  50 + QQAPIMESSAGETYPEINVALID = 9, // 消息类型无效
  51 + QQAPIMESSAGECONTENTNULL = 10, // 消息内容为空
  52 + QQAPIMESSAGECONTENTINVALID = 11, // 消息内容无效
  53 + QQAPIAPPNOTREGISTED = 12, // APP未注册
  54 + QQAPIAPPSHAREASYNC = 13, // 异步分享
  55 + QQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW = 14, // QQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW
  56 + QQAPISENDFAILD = 15, // 发送失败
  57 + QQAPIQZONENOTSUPPORTTEXT = 16, // qzone分享不支持text类型分享
  58 + QQAPIQZONENOTSUPPORTIMAGE = 17, // qzone分享不支持image类型分享
  59 +
  60 + SinaSuccess = 18, // 成功
  61 + SinaUserCancel = 19, // 用户取消发送
  62 + SinaSentFail = 20, // 发送失败
  63 + SinaAuthDeny = 21, // 授权失败
  64 + SinaUserCancelInstall = 22, // 用户取消安装微博客户端
  65 + SinaShareInSDKFailed = 23, // 分享失败
  66 + SinaUnsupport = 24, // 不支持的请求
  67 +
  68 + UnknowErrorCode = -999, // 未知错误
  69 +}CNErrorCode;
  70 +
  71 +#endif
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveUserInfoModel.h 0 → 100644
  1 +//
  2 +// CNLiveUserInfoModel.h
  3 +// 互动电视5.0
  4 +//
  5 +// Created by Kim on 15/6/17.
  6 +//
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +@interface CNLiveUserInfoModel : NSObject
  12 +
  13 +// Common
  14 +@property (nonatomic, strong)NSDictionary *originaInformation;
  15 +@property (nonatomic, copy)NSString *nickName;
  16 +@property (nonatomic, copy)NSString *gender;
  17 +@property (nonatomic, copy)NSString *province;
  18 +@property (nonatomic, copy)NSString *city;
  19 +@property (nonatomic, copy)NSString *imageUrl;
  20 +@property (nonatomic, copy)NSString *uid;
  21 +
  22 +// WeChat
  23 +@property (nonatomic, copy)NSString *country;
  24 +@property (nonatomic, copy)NSString *unionid;
  25 +
  26 +// WeChat&Sina
  27 +@property (nonatomic, copy)NSString *language;
  28 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveUserInfoModel.m 0 → 100644
  1 +//
  2 +// CNLiveUserInfoModel.m
  3 +// 互动电视5.0
  4 +//
  5 +// Created by Kim on 15/6/17.
  6 +//
  7 +//
  8 +
  9 +#import "CNLiveUserInfoModel.h"
  10 +
  11 +@implementation CNLiveUserInfoModel
  12 +
  13 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveWeChat.h 0 → 100644
  1 +//
  2 +// CNLiveWeChat.h
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/25.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <UIKit/UIKit.h>
  11 +#import "CNLiveEventHandlerDef.h"
  12 +#import "CNLiveTypeDef.h"
  13 +#import "CNLiveShareModel.h"
  14 +#import "WXApi.h"
  15 +
  16 +@interface CNLiveWeChat : NSObject<WXApiDelegate>
  17 +
  18 +- (void)getWeChatUserInfoWithAppId:(NSString *)appId AppSecret:(NSString *)appSecret userInfo:(GetUserInfoEventHandler)result;
  19 +
  20 +- (void)shareContentWithShareType:(ShareType)shareType shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result;
  21 +
  22 +- (void)logoutWithResult:(LogoutEventHandler)result;
  23 +
  24 +- (BOOL)isInstalledWeChat;
  25 +
  26 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/CNLiveWeChat.m 0 → 100644
  1 +//
  2 +// CNLiveWeChat.m
  3 +// WSShareSDK
  4 +//
  5 +// Created by CNLive on 15/5/25.
  6 +// Copyright (c) 2015年 wangshuai. All rights reserved.
  7 +//
  8 +
  9 +#import "CNLiveWeChat.h"
  10 +#import "CNLiveShare.h"
  11 +#import "CNLiveUserInfoModel.h"
  12 +#import "NSDictionary+CNLiveSafeDictionary.h"
  13 +
  14 +//第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传,state字符串长度不能超过1K
  15 +#define verificationCode @"cnlive"
  16 +
  17 +@interface CNLiveWeChat()
  18 +
  19 +@property (nonatomic, copy)GetUserInfoEventHandler userInfoBlock;
  20 +@property (nonatomic, copy)ShareResult shareResultBlock;
  21 +@property (nonatomic, copy)NSString *appId;
  22 +@property (nonatomic, copy)NSString *appSecret;
  23 +@property (nonatomic, copy)NSString *appCode;
  24 +
  25 +@end
  26 +@implementation CNLiveWeChat
  27 +
  28 +#pragma mark - getUserInfo
  29 +- (void)getWeChatUserInfoWithAppId:(NSString *)appId AppSecret:(NSString *)appSecret userInfo:(GetUserInfoEventHandler)result
  30 +{
  31 + //构造SendAuthReq结构体
  32 + SendAuthReq* req =[[SendAuthReq alloc ] init];
  33 + req.scope = @"snsapi_userinfo" ;
  34 + req.state = verificationCode;
  35 + self.userInfoBlock = result;
  36 + self.appId = appId;
  37 + self.appSecret = appSecret;
  38 +
  39 + //第三方向微信终端发送一个SendAuthReq消息结构
  40 + [WXApi sendReq:req];
  41 +}
  42 +- (void)getWeChatUserInfo
  43 +{
  44 +
  45 + NSString *url =[NSString stringWithFormat:@"https://api.weixin.qq.com/sns/oauth2/access_token?appid=%@&secret=%@&code=%@&grant_type=authorization_code",self.appId,self.appSecret,self.appCode];
  46 +
  47 + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
  48 + NSURL *zoneUrl = [NSURL URLWithString:url];
  49 + NSString *zoneStr = [NSString stringWithContentsOfURL:zoneUrl encoding:NSUTF8StringEncoding error:nil];
  50 + NSData *data = [zoneStr dataUsingEncoding:NSUTF8StringEncoding];
  51 + dispatch_async(dispatch_get_main_queue(), ^{
  52 + if (data) {
  53 + NSDictionary *dic = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] safeDictionary];
  54 +
  55 + if ([[dic allKeys] containsObject:@"errcode"]) {
  56 +
  57 + self.userInfoBlock(NO, nil, [dic objectForKey:@"errmsg"]);
  58 + }
  59 + else {
  60 +
  61 + [self getUserInfoWithAccessTocken:[dic objectForKey:@"access_token"] OpenID:[dic objectForKey:@"openid"]];
  62 + }
  63 + }
  64 + });
  65 + });
  66 +}
  67 +
  68 +- (void)getUserInfoWithAccessTocken:(NSString *)accessTocken OpenID:(NSString *)openID
  69 +{
  70 + NSString *getUserInfoUrl =[NSString stringWithFormat:@"https://api.weixin.qq.com/sns/userinfo?access_token=%@&openid=%@", accessTocken, openID];
  71 +
  72 + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
  73 + NSURL *zoneUrl = [NSURL URLWithString:getUserInfoUrl];
  74 + NSString *zoneStr = [NSString stringWithContentsOfURL:zoneUrl encoding:NSUTF8StringEncoding error:nil];
  75 + NSData *data = [zoneStr dataUsingEncoding:NSUTF8StringEncoding];
  76 + dispatch_async(dispatch_get_main_queue(), ^{
  77 + if (data) {
  78 + NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
  79 +
  80 + if ([[dic allKeys] containsObject:@"errcode"]) {
  81 +
  82 + self.userInfoBlock(NO, nil, [dic objectForKey:@"errmsg"]);
  83 + }
  84 + else {
  85 + CNLiveUserInfoModel *model = [[CNLiveUserInfoModel alloc] init];
  86 + model.originaInformation = dic;
  87 + model.nickName = [dic objectForKey:@"nickname"];
  88 + model.imageUrl = [dic objectForKey:@"headimgurl"];
  89 + model.uid = [dic objectForKey:@"openid"];
  90 + model.country = [dic objectForKey:@"country"];
  91 + model.language = [dic objectForKey:@"language"];
  92 + model.unionid = [dic objectForKey:@"unionid"];
  93 + model.province = [dic objectForKey:@"province"];
  94 + if (model.province == nil || model.province.length == 0) {
  95 + model.province = @"空";
  96 + }
  97 + model.city = [dic objectForKey:@"city"];
  98 + if (model.city == nil || model.city.length == 0) {
  99 + model.city = @"空";
  100 + }
  101 + NSString *gender = [dic objectForKey:@"sex"];
  102 + switch ([gender intValue]) {
  103 + case 0:
  104 + {
  105 + model.gender = @"n";
  106 + }
  107 + break;
  108 + case 1:
  109 + {
  110 + model.gender = @"m";
  111 + }
  112 + break;
  113 + case 2:
  114 + {
  115 + model.gender = @"f";
  116 + }
  117 + break;
  118 + default:
  119 + break;
  120 + }
  121 + self.userInfoBlock(YES, model, @"");
  122 + }
  123 +
  124 + }
  125 + });
  126 +
  127 + });
  128 +}
  129 +// WXApiDelegate
  130 +- (void)onResp:(BaseResp *)resp
  131 +{
  132 +
  133 + if([resp isKindOfClass:[SendAuthResp class]]) {
  134 +
  135 + SendAuthResp *temp = (SendAuthResp*)resp;
  136 +
  137 + if (temp.errCode == 0) {
  138 + // 用户已经授权
  139 +
  140 + if ([temp.state isEqualToString:verificationCode]) {
  141 +
  142 + self.appCode = temp.code;
  143 +
  144 + [self getWeChatUserInfo];
  145 +
  146 + }
  147 +
  148 + }
  149 + else if (temp.errCode == -4) {
  150 + // 用户拒绝授权
  151 + self.userInfoBlock(NO, nil, @"用户拒绝授权");
  152 + }
  153 + else if (temp.errCode == -2) {
  154 + // 用户取消
  155 + self.userInfoBlock(NO, nil, @"用户取消");
  156 + }
  157 + }
  158 + else if ([resp isKindOfClass:[SendMessageToWXResp class]]) {
  159 +
  160 + SendMessageToWXResp *temp = (SendMessageToWXResp *)resp;
  161 +
  162 + if (temp.errCode == 0) {
  163 + // 发送成功
  164 + self.shareResultBlock(YES, WeChatSuccess, @"发送成功");
  165 + }
  166 + else if (temp.errCode == -2) {
  167 + // 用户取消
  168 + self.shareResultBlock(NO, WeChatErrCodeUserCancel, @"用户取消");
  169 + }
  170 + else if (temp.errCode == -3) {
  171 + // 发送失败
  172 + self.shareResultBlock(NO, WeChatErrCodeSentFail, @"发送失败");
  173 + }
  174 + }
  175 + else if([resp isKindOfClass:[PayResp class]]){
  176 +
  177 +// switch (resp.errCode) {
  178 +// case WXSuccess:
  179 +// [self postPayResultNotification:PayNotification payState:PaySuccess];
  180 +// break;
  181 +//
  182 +// case WXErrCodeUserCancel:
  183 +// [self postPayResultNotification:PayNotification payState:UserCancel];
  184 +// break;
  185 +//
  186 +// default:
  187 +// [self postPayResultNotification:PayNotification payState:PayFailure];
  188 +// break;
  189 +// }
  190 + }
  191 +
  192 +}
  193 +
  194 +- (void)postPayResultNotification:(NSString *)notification payState:(NSString *)isSuccess
  195 +{
  196 + [[NSNotificationCenter defaultCenter] postNotificationName:notification object:isSuccess];
  197 +}
  198 +
  199 +#pragma mark - shareContent
  200 +- (void)shareContentWithShareType:(ShareType)shareType shareModel:(CNLiveShareModel *)shareModel shareResult:(ShareResult)result
  201 +{
  202 + self.shareResultBlock = result;
  203 + WXMediaMessage *message = [WXMediaMessage message];
  204 + message.title = shareModel.title;
  205 + message.description = shareModel.descriptions;
  206 +
  207 + NSData *shareImageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:shareModel.imageURL]];
  208 +
  209 + D_NSLog(@"shareImageData.length = %lu",(unsigned long)shareImageData.length);
  210 + if (shareImageData.length >= 32000) {
  211 + shareImageData = UIImageJPEGRepresentation([UIImage imageWithData:shareImageData], 0.1);
  212 + D_NSLog(@"compression %lu",(unsigned long)shareImageData.length);
  213 + }
  214 +
  215 + if (shareImageData.length >= 32000) {
  216 + shareImageData = UIImageJPEGRepresentation([self imageCompressForWidth:[UIImage imageWithData:shareImageData] targetWidth:500], 0.1);
  217 + D_NSLog(@"shear %lu",(unsigned long)shareImageData.length);
  218 + }
  219 + [message setThumbData:shareImageData];
  220 +
  221 + WXWebpageObject *ext = [WXWebpageObject object];
  222 + ext.webpageUrl = shareModel.url;
  223 +
  224 + message.mediaObject = ext;
  225 + message.mediaTagName = @"CNLIVE_WECHAT_TAG_SHARECONTENT";
  226 +
  227 + SendMessageToWXReq* req = [[SendMessageToWXReq alloc] init];
  228 + req.bText = NO;
  229 + req.message = message;
  230 + req.scene = shareType;
  231 + BOOL ret = [WXApi sendReq:req];
  232 +
  233 + // NSLog(@"%@",ret ? @"打开微信成功-----" : @"打开微信失败-----");
  234 +}
  235 +
  236 +-(UIImage *) imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth
  237 +{
  238 + CGSize imageSize = sourceImage.size;
  239 + CGFloat width = imageSize.width;
  240 + CGFloat height = imageSize.height;
  241 + CGFloat targetWidth = defineWidth;
  242 + CGFloat targetHeight = (targetWidth / width) * height;
  243 + UIGraphicsBeginImageContext(CGSizeMake(targetWidth, targetHeight));
  244 + [sourceImage drawInRect:CGRectMake(0,0,targetWidth, targetHeight)];
  245 + UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
  246 + UIGraphicsEndImageContext();
  247 + return newImage;
  248 +}
  249 +
  250 +#pragma mark - logout
  251 +- (void)logoutWithResult:(LogoutEventHandler)result
  252 +{
  253 + if (result) {
  254 + result(YES, @"");
  255 + }
  256 +}
  257 +
  258 +#pragma mark - isInstalledWeChat
  259 +- (BOOL)isInstalledWeChat
  260 +{
  261 + return [WXApi isWXAppInstalled];
  262 +}
  263 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/NSDictionary+CNLiveSafeDictionary.h 0 → 100644
  1 +//
  2 +// NSDictionary+CNLiveSafeDictionary.h
  3 +// CNLive
  4 +//
  5 +// Created by 王帅 on 16/1/11.
  6 +// Copyright © 2016年 雷浩杰. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +@interface NSDictionary (CNLiveSafeDictionary)
  12 +
  13 +- (NSDictionary *)safeDictionary;
  14 +
  15 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/Core/NSDictionary+CNLiveSafeDictionary.m 0 → 100644
  1 +//
  2 +// NSDictionary+CNLiveSafeDictionary.m
  3 +// CNLive
  4 +//
  5 +// Created by 王帅 on 16/1/11.
  6 +// Copyright © 2016年 雷浩杰. All rights reserved.
  7 +//
  8 +
  9 +#import "NSDictionary+CNLiveSafeDictionary.h"
  10 +
  11 +@implementation NSDictionary (CNLiveSafeDictionary)
  12 +
  13 +- (NSDictionary *)safeDictionary
  14 +{
  15 + NSDictionary *dictionary = self;
  16 + if (dictionary && [dictionary isKindOfClass:[NSDictionary class]]) {
  17 + NSArray *keysArray = [dictionary allKeys];
  18 + NSMutableDictionary *newMDic = [[NSMutableDictionary alloc] initWithCapacity:0];
  19 +
  20 + for (NSString *key in keysArray) {
  21 + id value = [dictionary objectForKey:key];
  22 + if (value && ![value isKindOfClass:[NSNull class]]) {
  23 +
  24 + if ([value isKindOfClass:[NSNumber class]]) {
  25 + NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
  26 + NSString *valueStr = [numberFormatter stringFromNumber:value];
  27 + [newMDic setObject:valueStr forKey:key];
  28 + }
  29 + else {
  30 + [newMDic setObject:value forKey:key];
  31 + }
  32 +
  33 + }
  34 + else {
  35 + [newMDic setObject:@"" forKey:key];
  36 + }
  37 + }
  38 +
  39 + return [newMDic copy];
  40 + }
  41 + else {
  42 + return nil;
  43 + }
  44 +}
  45 +
  46 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterface.h 0 → 100644
  1 +///
  2 +/// \file QQApiInterface.h
  3 +/// \brief QQApi接口简化封装
  4 +///
  5 +/// Created by Tencent on 12-5-15.
  6 +/// Copyright (c) 2012年 Tencent. All rights reserved.
  7 +///
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import "QQApiInterfaceObject.h"
  11 +
  12 +/**
  13 + \brief 处理来至QQ的请求及响应的回调协议
  14 + */
  15 +@protocol QQApiInterfaceDelegate <NSObject>
  16 +
  17 +/**
  18 + 处理来至QQ的请求
  19 + */
  20 +- (void)onReq:(QQBaseReq *)req;
  21 +
  22 +/**
  23 + 处理来至QQ的响应
  24 + */
  25 +- (void)onResp:(QQBaseResp *)resp;
  26 +
  27 +/**
  28 + 处理QQ在线状态的回调
  29 + */
  30 +- (void)isOnlineResponse:(NSDictionary *)response;
  31 +
  32 +@end
  33 +
  34 +/**
  35 + \brief 对QQApi的简单封装类
  36 + */
  37 +@interface QQApiInterface : NSObject
  38 +
  39 +/**
  40 + 处理由手Q唤起的跳转请求
  41 + \param url 待处理的url跳转请求
  42 + \param delegate 第三方应用用于处理来至QQ请求及响应的委托对象
  43 + \return 跳转请求处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败
  44 + */
  45 ++ (BOOL)handleOpenURL:(NSURL *)url delegate:(id<QQApiInterfaceDelegate>)delegate;
  46 +
  47 +/**
  48 + 向手Q发起分享请求
  49 + \param req 分享内容的请求
  50 + \return 请求发送结果码
  51 + */
  52 ++ (QQApiSendResultCode)sendReq:(QQBaseReq *)req;
  53 +
  54 +/**
  55 + 向手Q QZone结合版发起分享请求
  56 + \note H5分享只支持单张网络图片的传递
  57 + \param req 分享内容的请求
  58 + \return 请求发送结果码
  59 + */
  60 ++ (QQApiSendResultCode)SendReqToQZone:(QQBaseReq *)req;
  61 +
  62 +/**
  63 + 向手Q 群部落发起分享请求
  64 + \note H5分享只支持单张网络图片的传递
  65 + \param req 分享内容的请求
  66 + \return 请求发送结果码
  67 + */
  68 ++ (QQApiSendResultCode)SendReqToQQGroupTribe:(QQBaseReq *)req;
  69 +
  70 +/**
  71 + 向手Q发送应答消息
  72 + \param resp 应答消息
  73 + \return 应答发送结果码
  74 + */
  75 ++ (QQApiSendResultCode)sendResp:(QQBaseResp *)resp;
  76 +
  77 +/**
  78 + 检测是否已安装QQ
  79 + \return 如果QQ已安装则返回YES,否则返回NO
  80 + */
  81 ++ (BOOL)isQQInstalled;
  82 +
  83 +/**
  84 + 批量检测QQ号码是否在线
  85 + */
  86 ++ (void)getQQUinOnlineStatues:(NSArray *)QQUins delegate:(id<QQApiInterfaceDelegate>)delegate;
  87 +
  88 +/**
  89 + 检测QQ是否支持API调用
  90 + \return 如果当前安装QQ版本支持API调用则返回YES,否则返回NO
  91 + */
  92 ++ (BOOL)isQQSupportApi;
  93 +
  94 +/**
  95 + 启动QQ
  96 + \return 成功返回YES,否则返回NO
  97 + */
  98 ++ (BOOL)openQQ;
  99 +
  100 +/**
  101 + 获取QQ下载地址
  102 +
  103 + 如果App通过<code>QQApiInterface#isQQInstalled</code>和<code>QQApiInterface#isQQSupportApi</code>检测发现QQ没安装或当前版本QQ不支持API调用,可引导用户通过打开此链接下载最新版QQ。
  104 + \return iPhoneQQ下载地址
  105 + */
  106 ++ (NSString *)getQQInstallUrl;
  107 +
  108 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h 0 → 100644
  1 +///
  2 +/// \file QQApiInterfaceObject.h
  3 +/// \brief QQApiInterface所依赖的请求及应答消息对象封装帮助类
  4 +///
  5 +/// Created by Tencent on 12-5-15.
  6 +/// Copyright (c) 2012年 Tencent. All rights reserved.
  7 +///
  8 +
  9 +#ifndef QQApiInterface_QQAPIOBJECT_h
  10 +#define QQApiInterface_QQAPIOBJECT_h
  11 +
  12 +#import <Foundation/Foundation.h>
  13 +
  14 +
  15 +typedef enum
  16 +{
  17 + EQQAPISENDSUCESS = 0,
  18 + EQQAPIQQNOTINSTALLED = 1,
  19 + EQQAPIQQNOTSUPPORTAPI = 2,
  20 + EQQAPIMESSAGETYPEINVALID = 3,
  21 + EQQAPIMESSAGECONTENTNULL = 4,
  22 + EQQAPIMESSAGECONTENTINVALID = 5,
  23 + EQQAPIAPPNOTREGISTED = 6,
  24 + EQQAPIAPPSHAREASYNC = 7,
  25 + EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW = 8,
  26 + EQQAPISENDFAILD = -1,
  27 + //qzone分享不支持text类型分享
  28 + EQQAPIQZONENOTSUPPORTTEXT = 10000,
  29 + //qzone分享不支持image类型分享
  30 + EQQAPIQZONENOTSUPPORTIMAGE = 10001,
  31 +} QQApiSendResultCode;
  32 +
  33 +#pragma mark - QQApiObject(分享对象类型)
  34 +
  35 +// QQApiObject control flags
  36 +enum
  37 +{
  38 + kQQAPICtrlFlagQZoneShareOnStart = 0x01,
  39 + kQQAPICtrlFlagQZoneShareForbid = 0x02,
  40 + kQQAPICtrlFlagQQShare = 0x04,
  41 + kQQAPICtrlFlagQQShareFavorites = 0x08, //收藏
  42 + kQQAPICtrlFlagQQShareDataline = 0x10, //数据线
  43 +};
  44 +
  45 +// QQApiObject
  46 +/** \brief 所有在QQ及插件间发送的数据对象的根类。
  47 + */
  48 +@interface QQApiObject : NSObject
  49 +@property(nonatomic,retain) NSString* title; ///< 标题,最长128个字符
  50 +@property(nonatomic,retain) NSString* description; ///<简要描述,最长512个字符
  51 +
  52 +@property (nonatomic, assign) uint64_t cflag;
  53 +
  54 +@end
  55 +
  56 +// QQApiResultObject
  57 +/** \brief 用于请求回应的数据类型。
  58 + <h3>可能错误码及描述如下:</h3>
  59 + <TABLE>
  60 + <TR><TD>error</TD><TD>errorDescription</TD><TD>注释</TD></TR>
  61 + <TR><TD>0</TD><TD>nil</TD><TD>成功</TD></TR>
  62 + <TR><TD>-1</TD><TD>param error</TD><TD>参数错误</TD></TR>
  63 + <TR><TD>-2</TD><TD>group code is invalid</TD><TD>该群不在自己的群列表里面</TD></TR>
  64 + <TR><TD>-3</TD><TD>upload photo failed</TD><TD>上传图片失败</TD></TR>
  65 + <TR><TD>-4</TD><TD>user give up the current operation</TD><TD>用户放弃当前操作</TD></TR>
  66 + <TR><TD>-5</TD><TD>client internal error</TD><TD>客户端内部处理错误</TD></TR>
  67 + </TABLE>
  68 + */
  69 +@interface QQApiResultObject : QQApiObject
  70 +@property(nonatomic,retain) NSString* error; ///<错误
  71 +@property(nonatomic,retain) NSString* errorDescription; ///<错误描述
  72 +@property(nonatomic,retain) NSString* extendInfo; ///<扩展信息
  73 +@end
  74 +
  75 +// QQApiTextObject
  76 +/** \brief 文本对象
  77 + */
  78 +@interface QQApiTextObject : QQApiObject
  79 +@property(nonatomic,retain)NSString* text; ///<文本内容,必填,最长1536个字符
  80 +
  81 +-(id)initWithText:(NSString*)text; ///<初始化方法
  82 ++(id)objectWithText:(NSString*)text;///<工厂方法,获取一个QQApiTextObject对象.
  83 +@end
  84 +
  85 +// QQApiURLObject
  86 +typedef enum QQApiURLTargetType{
  87 + QQApiURLTargetTypeNotSpecified = 0x00,
  88 + QQApiURLTargetTypeAudio = 0x01,
  89 + QQApiURLTargetTypeVideo = 0x02,
  90 + QQApiURLTargetTypeNews = 0x03
  91 +}QQApiURLTargetType;
  92 +
  93 +/** @brief URL对象类型。
  94 +
  95 + 包括URL地址,URL地址所指向的目标类型及预览图像。
  96 + */
  97 +@interface QQApiURLObject : QQApiObject
  98 +/**
  99 + URL地址所指向的目标类型.
  100 + @note 参见QQApi.h 中的 QQApiURLTargetType 定义.
  101 + */
  102 +@property(nonatomic)QQApiURLTargetType targetContentType;
  103 +
  104 +@property(nonatomic,retain)NSURL* url; ///<URL地址,必填,最长512个字符
  105 +@property(nonatomic,retain)NSData* previewImageData;///<预览图像数据,最大1M字节
  106 +@property(nonatomic, retain) NSURL *previewImageURL; ///<预览图像URL **预览图像数据与预览图像URL可二选一
  107 +
  108 +/**
  109 + 初始化方法
  110 + */
  111 +-(id)initWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data targetContentType:(QQApiURLTargetType)targetContentType;
  112 +-(id)initWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL targetContentType:(QQApiURLTargetType)targetContentType;
  113 +/**
  114 + 工厂方法,获取一个QQApiURLObject对象
  115 + */
  116 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data targetContentType:(QQApiURLTargetType)targetContentType;
  117 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL targetContentType:(QQApiURLTargetType)targetContentType;
  118 +@end
  119 +
  120 +// QQApiExtendObject
  121 +/** @brief 扩展数据类型
  122 + */
  123 +@interface QQApiExtendObject : QQApiObject
  124 +@property(nonatomic,retain) NSData* data;///<具体数据内容,必填,最大5M字节
  125 +@property(nonatomic,retain) NSData* previewImageData;///<预览图像,最大1M字节
  126 +@property(nonatomic,retain) NSArray* imageDataArray;///图片数组(多图暂只支持分享到手机QQ收藏功能)
  127 +
  128 +/**
  129 + 初始化方法
  130 + @param data 数据内容
  131 + @param previewImageData 用于预览的图片
  132 + @param title 标题
  133 + @param description 此对象,分享的描述
  134 + */
  135 +- (id)initWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description;
  136 +
  137 +/**
  138 + 初始化方法
  139 + @param data 数据内容
  140 + @param title 标题
  141 + @param description 此对象,分享的描述
  142 + @param imageDataArray 发送的多张图片队列
  143 + */
  144 +- (id)initWithData:(NSData *)data previewImageData:(NSData*)previewImageData title:(NSString *)title description:(NSString *)description imageDataArray:(NSArray *)imageDataArray;
  145 +
  146 +/**
  147 + helper方法获取一个autorelease的<code>QQApiExtendObject</code>对象
  148 + @param data 数据内容
  149 + @param previewImageData 用于预览的图片
  150 + @param title 标题
  151 + @param description 此对象,分享的描述
  152 + @return
  153 + 一个自动释放的<code>QQApiExtendObject</code>实例
  154 + */
  155 ++ (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description;
  156 +
  157 +/**
  158 + helper方法获取一个autorelease的<code>QQApiExtendObject</code>对象
  159 + @param data 数据内容
  160 + @param previewImageData 用于预览的图片
  161 + @param title 标题
  162 + @param description 此对象,分享的描述
  163 + @param imageDataArray 发送的多张图片队列
  164 + @return
  165 + 一个自动释放的<code>QQApiExtendObject</code>实例
  166 + */
  167 ++ (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description imageDataArray:(NSArray*)imageDataArray;
  168 +
  169 +@end
  170 +
  171 +// QQApiImageObject
  172 +/** @brief 图片对象
  173 + 用于分享图片内容的对象,是一个指定为图片类型的<code>QQApiExtendObject</code>
  174 + */
  175 +@interface QQApiImageObject : QQApiExtendObject
  176 +@end
  177 +
  178 +// QQApiWebImageObject
  179 +/** @brief 图片对象
  180 + 用于分享网络图片内容的对象,是一个指定网络图片url的: 该类型只在2.9.0的h5分享中才支持,
  181 + 原有的手q分享是不支持该类型的。
  182 + */
  183 +@interface QQApiWebImageObject : QQApiObject
  184 +
  185 +@property(nonatomic, retain) NSURL *previewImageURL; ///<预览图像URL
  186 +
  187 +/**
  188 + 初始化方法
  189 + @param previewImageURL 用于预览的图片
  190 + @param title 标题
  191 + @param description 此对象,分享的描述
  192 + */
  193 +- (id)initWithPreviewImageURL:(NSURL*)previewImageURL title:(NSString*)title description:(NSString*)description;
  194 +
  195 +/**
  196 + helper方法获取一个autorelease的<code>QQApiWebImageObject</code>对象
  197 + @param previewImageURL 用于预览的图片
  198 + @param title 标题
  199 + @param description 此对象,分享的描述
  200 + */
  201 ++ (id)objectWithPreviewImageURL:(NSURL*)previewImageURL title:(NSString*)title description:(NSString*)description;
  202 +
  203 +@end
  204 +
  205 +// QQApiGroupTribeImageObject
  206 +/** @brief 群部落图片对象
  207 + 用于分享图片内容的对象,是一个指定为图片类型的 可以指定一些其他的附加数据<code>QQApiExtendObject</code>
  208 + */
  209 +@interface QQApiGroupTribeImageObject : QQApiImageObject
  210 +{
  211 + NSString *_bid;
  212 + NSString *_bname;
  213 +}
  214 +// 群部落id
  215 +@property (nonatomic, retain)NSString* bid;
  216 +
  217 +// 群部落名称
  218 +@property (nonatomic, retain)NSString* bname;
  219 +
  220 +@end
  221 +
  222 +
  223 +//QQApiFileObject
  224 +/** @brief 本地文件对象(暂只支持分享到手机QQ数据线功能)
  225 + 用于分享文件内容的对象,是一个指定为文件类型的<code>QQApiExtendObject</code>
  226 + */
  227 +@interface QQApiFileObject : QQApiExtendObject
  228 +{
  229 + NSString* _fileName;
  230 +}
  231 +@property(nonatomic, retain)NSString* fileName;
  232 +@end
  233 +
  234 +// QQApiAudioObject
  235 +/** @brief 音频URL对象
  236 + 用于分享目标内容为音频的URL的对象
  237 + */
  238 +@interface QQApiAudioObject : QQApiURLObject
  239 +
  240 +@property (nonatomic, retain) NSURL *flashURL; ///<音频URL地址,最长512个字符
  241 +
  242 +/**
  243 + 获取一个autorelease的<code>QQApiAudioObject</code>
  244 + @param url 音频内容的目标URL
  245 + @param title 分享内容的标题
  246 + @param description 分享内容的描述
  247 + @param data 分享内容的预览图像
  248 + @note 如果url为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
  249 + */
  250 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data;
  251 +
  252 +/**
  253 + 获取一个autorelease的<code>QQApiAudioObject</code>
  254 + @param url 音频内容的目标URL
  255 + @param title 分享内容的标题
  256 + @param description 分享内容的描述
  257 + @param previewURL 分享内容的预览图像URL
  258 + @note 如果url为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
  259 + */
  260 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL;
  261 +
  262 +@end
  263 +
  264 +// QQApiVideoObject
  265 +/** @brief 视频URL对象
  266 + 用于分享目标内容为视频的URL的对象
  267 +
  268 + QQApiVideoObject类型的分享,目前在Android和PC QQ上接收消息时,展现有待完善,待手机QQ版本以后更新支持
  269 + 目前如果要分享视频,推荐使用 QQApiNewsObject 类型
  270 + */
  271 +@interface QQApiVideoObject : QQApiURLObject
  272 +
  273 +@property (nonatomic, retain) NSURL *flashURL; ///<视频URL地址,最长512个字符
  274 +
  275 +/**
  276 + 获取一个autorelease的<code>QQApiVideoObject</code>
  277 + @param url 视频内容的目标URL
  278 + @param title 分享内容的标题
  279 + @param description 分享内容的描述
  280 + @param data 分享内容的预览图像
  281 + @note 如果url为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
  282 + */
  283 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data;
  284 +
  285 +/**
  286 + 获取一个autorelease的<code>QQApiVideoObject</code>
  287 + @param url 视频内容的目标URL
  288 + @param title 分享内容的标题
  289 + @param description 分享内容的描述
  290 + @param previewURL 分享内容的预览图像URL
  291 + @note 如果url为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
  292 + */
  293 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL;
  294 +
  295 +@end
  296 +
  297 +// QQApiNewsObject
  298 +/** @brief 新闻URL对象
  299 + 用于分享目标内容为新闻的URL的对象
  300 + */
  301 +@interface QQApiNewsObject : QQApiURLObject
  302 +/**
  303 + 获取一个autorelease的<code>QQApiNewsObject</code>
  304 + @param url 视频内容的目标URL
  305 + @param title 分享内容的标题
  306 + @param description 分享内容的描述
  307 + @param data 分享内容的预览图像
  308 + @note 如果url为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
  309 + */
  310 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data;
  311 +
  312 +/**
  313 + 获取一个autorelease的<code>QQApiNewsObject</code>
  314 + @param url 视频内容的目标URL
  315 + @param title 分享内容的标题
  316 + @param description 分享内容的描述
  317 + @param previewURL 分享内容的预览图像URL
  318 + @note 如果url为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
  319 + */
  320 ++(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL;
  321 +
  322 +@end
  323 +
  324 +// QQApiPayObject
  325 +/** \brief 支付对象
  326 + */
  327 +@interface QQApiPayObject : QQApiObject
  328 +@property(nonatomic,retain)NSString* OrderNo; ///<支付订单号,必填
  329 +@property(nonatomic,retain)NSString* AppInfo; ///<支付来源信息,必填
  330 +
  331 +-(id)initWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo; ///<初始化方法
  332 ++(id)objectWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo;///<工厂方法,获取一个QQApiPayObject对象.
  333 +@end
  334 +
  335 +// QQApiCommonContentObject;
  336 +/** @brief 通用模板类型对象
  337 + 用于分享一个固定显示模板的图文混排对象
  338 + @note 图片列表和文本列表不能同时为空
  339 + */
  340 +@interface QQApiCommonContentObject : QQApiObject
  341 +/**
  342 + 预定义的界面布局类型
  343 + */
  344 +@property(nonatomic,assign) unsigned int layoutType;
  345 +@property(nonatomic,assign) NSData* previewImageData;///<预览图
  346 +@property(nonatomic,retain) NSArray* textArray;///<文本列表
  347 +@property(nonatomic,retain) NSArray* pictureDataArray;///<图片列表
  348 ++(id)objectWithLayoutType:(int)layoutType textArray:(NSArray*)textArray pictureArray:(NSArray*)pictureArray previewImageData:(NSData*)data;
  349 +/**
  350 + 将一个NSDictionary对象转化为QQApiCommomContentObject,如果无法转换,则返回空
  351 + */
  352 ++(id)objectWithDictionary:(NSDictionary*)dic;
  353 +-(NSDictionary*)toDictionary;
  354 +@end
  355 +
  356 +////////////////////////////////////////////////////////////////////////////////////////////////////////////
  357 +// Ad item object definition
  358 +////////////////////////////////////////////////////////////////////////////////////////////////////////////
  359 +/** @brief 广告数据对象
  360 + */
  361 +@interface QQApiAdItem : NSObject
  362 +@property(nonatomic,retain) NSString* title; ///<名称
  363 +@property(nonatomic,retain) NSString* description;///<描述
  364 +@property(nonatomic,retain) NSData* imageData;///<广告图片
  365 +@property(nonatomic,retain) NSURL* target;///<广告目标链接
  366 +@end
  367 +
  368 +// QQApiWPAObject
  369 +/** \brief 发起WPA对象
  370 + */
  371 +@interface QQApiWPAObject : QQApiObject
  372 +@property(nonatomic,retain)NSString* uin; ///<想要对话的QQ号
  373 +
  374 +-(id)initWithUin:(NSString*)uin; ///<初始化方法
  375 ++(id)objectWithUin:(NSString*)uin;///<工厂方法,获取一个QQApiWPAObject对象.
  376 +@end
  377 +
  378 +// QQApiAddFriendObject
  379 +/** \brief 添加好友
  380 + */
  381 +@interface QQApiAddFriendObject : QQApiObject
  382 +@property (nonatomic,retain)NSString* openID;
  383 +@property (nonatomic,retain)NSString* subID;
  384 +@property (nonatomic,retain)NSString* remark;
  385 +
  386 +-(id)initWithOpenID:(NSString*)openID; ///<初始化方法
  387 ++(id)objecWithOpenID:(NSString*)openID; ///<工厂方法,获取一个QQApiAddFriendObject对象.
  388 +
  389 +@end
  390 +
  391 +// QQApiGameConsortiumBindingGroupObject
  392 +/** \brief 游戏公会绑定群
  393 + */
  394 +@interface QQApiGameConsortiumBindingGroupObject : QQApiObject
  395 +@property (nonatomic,retain)NSString* signature;
  396 +@property (nonatomic,retain)NSString* unionid;
  397 +@property (nonatomic,retain)NSString* zoneID;
  398 +@property (nonatomic,retain)NSString* appDisplayName;
  399 +
  400 +-(id)initWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<初始化方法
  401 ++(id)objectWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<工厂方法,获取一个QQApiAddFriendObject对象.
  402 +
  403 +@end
  404 +
  405 +// QQApiGroupChatObject
  406 +/** \brief 发起群会话对象
  407 + */
  408 +@interface QQApiGroupChatObject : QQApiObject
  409 +@property(nonatomic,retain)NSString* groupID; ///<想要对话的群号
  410 +
  411 +-(id)initWithGroup:(NSString*)groupID; ///<初始化方法
  412 ++(id)objectWithGroup:(NSString*)groupID;///<工厂方法,获取一个QQApiGroupChatObject对象.
  413 +@end
  414 +
  415 +#pragma mark - QQApi请求消息类型
  416 +
  417 +/**
  418 + QQApi请求消息类型
  419 + */
  420 +enum QQApiInterfaceReqType
  421 +{
  422 + EGETMESSAGEFROMQQREQTYPE = 0, ///< 手Q -> 第三方应用,请求第三方应用向手Q发送消息
  423 + ESENDMESSAGETOQQREQTYPE = 1, ///< 第三方应用 -> 手Q,第三方应用向手Q分享消息
  424 + ESHOWMESSAGEFROMQQREQTYPE = 2 ///< 手Q -> 第三方应用,请求第三方应用展现消息中的数据
  425 +};
  426 +
  427 +/**
  428 + QQApi应答消息类型
  429 + */
  430 +enum QQApiInterfaceRespType
  431 +{
  432 + ESHOWMESSAGEFROMQQRESPTYPE = 0, ///< 第三方应用 -> 手Q,第三方应用应答消息展现结果
  433 + EGETMESSAGEFROMQQRESPTYPE = 1, ///< 第三方应用 -> 手Q,第三方应用回应发往手Q的消息
  434 + ESENDMESSAGETOQQRESPTYPE = 2 ///< 手Q -> 第三方应用,手Q应答处理分享消息的结果
  435 +};
  436 +
  437 +/**
  438 + QQApi请求消息基类
  439 + */
  440 +@interface QQBaseReq : NSObject
  441 +
  442 +/** 请求消息类型,参见\ref QQApiInterfaceReqType */
  443 +@property (nonatomic, assign) int type;
  444 +
  445 +@end
  446 +
  447 +/**
  448 + QQApi应答消息基类
  449 + */
  450 +@interface QQBaseResp : NSObject
  451 +
  452 +/** 请求处理结果 */
  453 +@property (nonatomic, copy) NSString* result;
  454 +
  455 +/** 具体错误描述信息 */
  456 +@property (nonatomic, copy) NSString* errorDescription;
  457 +
  458 +/** 应答消息类型,参见\ref QQApiInterfaceRespType */
  459 +@property (nonatomic, assign) int type;
  460 +
  461 +/** 扩展信息 */
  462 +@property (nonatomic, assign) NSString* extendInfo;
  463 +
  464 +@end
  465 +
  466 +/**
  467 + GetMessageFromQQReq请求帮助类
  468 + */
  469 +@interface GetMessageFromQQReq : QQBaseReq
  470 +
  471 +/**
  472 + 创建一个GetMessageFromQQReq请求实例
  473 + */
  474 ++ (GetMessageFromQQReq *)req;
  475 +
  476 +@end
  477 +
  478 +/**
  479 + GetMessageFromQQResp应答帮助类
  480 + */
  481 +@interface GetMessageFromQQResp : QQBaseResp
  482 +
  483 +/**
  484 + 创建一个GetMessageFromQQResp应答实例
  485 + \param message 具体分享消息实例
  486 + \return 新创建的GetMessageFromQQResp应答实例
  487 + */
  488 ++ (GetMessageFromQQResp *)respWithContent:(QQApiObject *)message;
  489 +
  490 +/** 具体分享消息 */
  491 +@property (nonatomic, retain) QQApiObject *message;
  492 +
  493 +@end
  494 +
  495 +/**
  496 + SendMessageToQQReq请求帮助类
  497 + */
  498 +@interface SendMessageToQQReq : QQBaseReq
  499 +
  500 +/**
  501 + 创建一个SendMessageToQQReq请求实例
  502 + \param message 具体分享消息实例
  503 + \return 新创建的SendMessageToQQReq请求实例
  504 + */
  505 ++ (SendMessageToQQReq *)reqWithContent:(QQApiObject *)message;
  506 +
  507 +/** 具体分享消息 */
  508 +@property (nonatomic, retain) QQApiObject *message;
  509 +
  510 +@end
  511 +
  512 +/**
  513 + SendMessageToQQResp应答帮助类
  514 + */
  515 +@interface SendMessageToQQResp : QQBaseResp
  516 +
  517 +/**
  518 + 创建一个SendMessageToQQResp应答实例
  519 + \param result 请求处理结果
  520 + \param errDesp 具体错误描述信息
  521 + \param extendInfo 扩展信息
  522 + \return 新创建的SendMessageToQQResp应答实例
  523 + */
  524 ++ (SendMessageToQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp extendInfo:(NSString*)extendInfo;
  525 +
  526 +@end
  527 +
  528 +/**
  529 + ShowMessageFromQQReq请求帮助类
  530 + */
  531 +@interface ShowMessageFromQQReq : QQBaseReq
  532 +
  533 +/**
  534 + 创建一个ShowMessageFromQQReq请求实例
  535 + \param message 具体待展现消息实例
  536 + \return 新创建的ShowMessageFromQQReq请求实例
  537 + */
  538 ++ (ShowMessageFromQQReq *)reqWithContent:(QQApiObject *)message;
  539 +
  540 +/** 具体待展现消息 */
  541 +@property (nonatomic, retain) QQApiObject *message;
  542 +
  543 +@end
  544 +
  545 +/**
  546 + ShowMessageFromQQResp应答帮助类
  547 + */
  548 +@interface ShowMessageFromQQResp : QQBaseResp
  549 +
  550 +/**
  551 + 创建一个ShowMessageFromQQResp应答实例
  552 + \param result 展现消息结果
  553 + \param errDesp 具体错误描述信息
  554 + \return 新创建的ShowMessageFromQQResp应答实例
  555 + */
  556 ++ (ShowMessageFromQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp;
  557 +
  558 +@end
  559 +
  560 +#endif
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuth.h 0 → 100644
  1 +///
  2 +/// \file TencentOAuth.h
  3 +/// \brief QQ互联开放平台授权登录及相关开放接口实现类
  4 +///
  5 +/// Created by Tencent on 12-12-21.
  6 +/// Copyright (c) 2012年 Tencent. All rights reserved.
  7 +///
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import "sdkdef.h"
  11 +#import "TencentOAuthObject.h"
  12 +
  13 +@protocol TencentSessionDelegate;
  14 +@protocol TencentLoginDelegate;
  15 +@protocol TencentApiInterfaceDelegate;
  16 +@protocol TencentWebViewDelegate;
  17 +
  18 +@class TencentApiReq;
  19 +@class TencentApiResp;
  20 +
  21 +typedef enum
  22 +{
  23 + kTencentNotAuthorizeState,
  24 + kTencentSSOAuthorizeState,
  25 + kTencentWebviewAuthorzieState,
  26 +} TencentAuthorizeState;
  27 +
  28 +typedef enum
  29 +{
  30 + kAuthModeClientSideToken,
  31 + kAuthModeServerSideCode,
  32 +} TencentAuthMode;
  33 +
  34 +#pragma mark - TencentOAuth(授权登录及相关开放接口调用)
  35 +
  36 +/**
  37 + * \brief TencentOpenAPI授权登录及相关开放接口调用
  38 + *
  39 + * TencentOAuth实现授权登录逻辑以及相关开放接口的请求调用
  40 + */
  41 +@interface TencentOAuth : NSObject
  42 +{
  43 + NSMutableDictionary* _apiRequests;
  44 + NSString* _accessToken;
  45 + NSDate* _expirationDate;
  46 + id<TencentSessionDelegate> _sessionDelegate;
  47 + NSString* _localAppId;
  48 + NSString* _openId;
  49 + NSString* _redirectURI;
  50 + NSArray* _permissions;
  51 +}
  52 +
  53 +/** Access Token凭证,用于后续访问各开放接口 */
  54 +@property(nonatomic, copy) NSString* accessToken;
  55 +
  56 +/** Access Token的失效期 */
  57 +@property(nonatomic, copy) NSDate* expirationDate;
  58 +
  59 +/** 已实现的开放接口的回调委托对象 */
  60 +@property(nonatomic, assign) id<TencentSessionDelegate> sessionDelegate;
  61 +
  62 +/** 第三方应用在开发过程中设置的URLSchema,用于浏览器登录后后跳到第三方应用 */
  63 +@property(nonatomic, copy) NSString* localAppId;
  64 +
  65 +/** 用户授权登录后对该用户的唯一标识 */
  66 +@property(nonatomic, copy) NSString* openId;
  67 +
  68 +/** 用户登录成功过后的跳转页面地址 */
  69 +@property(nonatomic, copy) NSString* redirectURI;
  70 +
  71 +/** 第三方应用在互联开放平台申请的appID */
  72 +@property(nonatomic, retain) NSString* appId;
  73 +
  74 +/** 主要是互娱的游戏设置uin */
  75 +@property(nonatomic, retain) NSString* uin;
  76 +
  77 +/** 主要是互娱的游戏设置鉴定票据 */
  78 +@property(nonatomic, retain) NSString* skey;
  79 +
  80 +/** 登陆透传的数据 */
  81 +@property(nonatomic, copy) NSDictionary* passData;
  82 +
  83 +/** 授权方式(Client Side Token或者Server Side Code) */
  84 +@property(nonatomic, assign) TencentAuthMode authMode;
  85 +
  86 +/**
  87 + * 用来获得当前sdk的版本号
  88 + * \return 返回sdk版本号
  89 + **/
  90 +
  91 ++ (NSString*)sdkVersion;
  92 +
  93 +/**
  94 + * 用来获得当前sdk的小版本号
  95 + * \return 返回sdk小版本号
  96 + **/
  97 +
  98 ++ (NSString*)sdkSubVersion;
  99 +
  100 +/**
  101 + * 用来获得当前sdk的是否精简版
  102 + * \return 返回YES表示精简版
  103 + **/
  104 +
  105 ++ (BOOL)isLiteSDK;
  106 +
  107 +/**
  108 + * 主要是用来帮助判断是否有登陆被发起,但是还没有过返回结果
  109 + * \return
  110 + * kTencentNotAuthorizeState:无授权
  111 + * kTencentSSOAuthorizeState:有人发起了sso授权但无返回
  112 + * kTencentWebviewAuthorzieState:有人发起了webview授权还未返回
  113 + **/
  114 +
  115 ++ (TencentAuthorizeState *)authorizeState;
  116 +
  117 +/**
  118 + * 用来获得当前手机qq的版本号
  119 + * \return 返回手机qq版本号
  120 + **/
  121 ++ (QQVersion)iphoneQQVersion;
  122 +
  123 +/**
  124 + * 初始化TencentOAuth对象
  125 + * \param appId 第三方应用在互联开放平台申请的唯一标识
  126 + * \param delegate 第三方应用用于接收请求返回结果的委托对象
  127 + * \return 初始化后的授权登录对象
  128 + */
  129 +- (id)initWithAppId:(NSString *)appId
  130 + andDelegate:(id<TencentSessionDelegate>)delegate;
  131 +
  132 +
  133 +/**
  134 + * 判断用户手机上是否安装手机QQ
  135 + * \return YES:安装 NO:没安装
  136 + */
  137 ++ (BOOL)iphoneQQInstalled;
  138 +
  139 +/**
  140 + * 判断用户手机上的手机QQ是否支持SSO登录
  141 + * \return YES:支持 NO:不支持
  142 + */
  143 ++ (BOOL)iphoneQQSupportSSOLogin;
  144 +
  145 +/**
  146 + * 判断用户手机上是否安装手机QZone
  147 + * \return YES:安装 NO:没安装
  148 + */
  149 ++ (BOOL)iphoneQZoneInstalled;
  150 +
  151 +/**
  152 + * 判断用户手机上的手机QZone是否支持SSO登录
  153 + * \return YES:支持 NO:不支持
  154 + */
  155 ++ (BOOL)iphoneQZoneSupportSSOLogin;
  156 +
  157 +/**
  158 + * 登录授权
  159 + *
  160 + * \param permissions 授权信息列
  161 + */
  162 +- (BOOL)authorize:(NSArray *)permissions;
  163 +
  164 +/**
  165 + * 登录授权
  166 + * \param permissions 授权信息列表
  167 + * \param bInSafari 是否使用safari进行登录.<b>IOS SDK 1.3版本开始此参数废除</b>
  168 + */
  169 +- (BOOL)authorize:(NSArray *)permissions
  170 + inSafari:(BOOL)bInSafari;
  171 +
  172 +/**
  173 + * 登录授权
  174 + * \param permissions 授权信息列表
  175 + * \param localAppId 应用APPID
  176 + * \param bInSafari 是否使用safari进行登录.<b>IOS SDK 1.3版本开始此参数废除</b>
  177 + */
  178 +- (BOOL)authorize:(NSArray *)permissions
  179 + localAppId:(NSString *)localAppId
  180 + inSafari:(BOOL)bInSafari;
  181 +
  182 +/**
  183 + * 增量授权,因用户没有授予相应接口调用的权限,需要用户确认是否授权
  184 + * \param permissions 需增量授权的信息列表
  185 + * \return 增量授权调用是否成功
  186 + */
  187 +- (BOOL)incrAuthWithPermissions:(NSArray *)permissions;
  188 +
  189 +/**
  190 + * 重新授权,因token废除或失效导致接口调用失败,需用户重新授权
  191 + * \param permissions 授权信息列表,同登录授权
  192 + * \return 授权调用是否成功
  193 + */
  194 +- (BOOL)reauthorizeWithPermissions:(NSArray *)permissions;
  195 +
  196 +/**
  197 + * (静态方法)处理应用拉起协议
  198 + * \param url 处理被其他应用呼起时的逻辑
  199 + * \return 处理结果,YES表示成功,NO表示失败
  200 + */
  201 ++ (BOOL)HandleOpenURL:(NSURL *)url;
  202 +
  203 +/**
  204 + * (静态方法)sdk是否可以处理应用拉起协议
  205 + * \param url 处理被其他应用呼起时的逻辑
  206 + * \return 处理结果,YES表示可以 NO表示不行
  207 + */
  208 ++ (BOOL)CanHandleOpenURL:(NSURL *)url;
  209 +
  210 +/**
  211 + * (静态方法)获取TencentOAuth调用的上一次错误信息
  212 + */
  213 ++ (NSString *)getLastErrorMsg;
  214 +
  215 +/**
  216 + * 以Server Side Code模式授权登录时,通过此接口获取返回的code值;
  217 + * 以Client Side Token模式授权登录时,忽略此接口。
  218 + */
  219 +- (NSString *)getServerSideCode;
  220 +
  221 +/**
  222 + * 退出登录(退出登录后,TecentOAuth失效,需要重新初始化)
  223 + * \param delegate 第三方应用用于接收请求返回结果的委托对象
  224 + */
  225 +- (void)logout:(id<TencentSessionDelegate>)delegate;
  226 +
  227 +/**
  228 + * 判断登录态是否有效
  229 + * \return 处理结果,YES表示有效,NO表示无效,请用户重新登录授权
  230 + */
  231 +- (BOOL)isSessionValid;
  232 +
  233 +/**
  234 + * 获取用户个人信息
  235 + * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录
  236 + */
  237 +- (BOOL)getUserInfo;
  238 +
  239 +/**
  240 + * SDK内置webview实现定向分享时,第三方应用可以根据应用是否在白名单里来开启该配置开关,默认为关闭;
  241 + * 在白名单里的应用调用该接口后,即打开sdk内置webview的二级白名单开关(相对与sdk后台的白名单),
  242 + * 那么在sdk后台白名单校验请求失败的情况下,会继续先尝试采用内置webview进行分享。
  243 + */
  244 +- (void)openSDKWebViewQQShareEnable;
  245 +
  246 +
  247 +/**
  248 + * 退出指定API调用
  249 + * \param userData 用户调用某条API的时候传入的保留参数
  250 + * \return 处理结果,YES表示成功 NO表示失败
  251 + */
  252 +- (BOOL)cancel:(id)userData;
  253 +
  254 +/**
  255 + * CGI类任务创建接口
  256 + * \param apiURL CGI请求的URL地址
  257 + * \param method CGI请求方式:"GET","POST"
  258 + * \param params CGI请求参数字典
  259 + * \param callback CGI请求结果的回调接口对象
  260 + * \return CGI请求任务实例,用于取消任务,返回nil代表任务创建失败
  261 + */
  262 +- (TCAPIRequest *)cgiRequestWithURL:(NSURL *)apiURL method:(NSString *)method params:(NSDictionary *)params callback:(id<TCAPIRequestDelegate>)callback;
  263 +
  264 +/**
  265 + * TencentOpenApi发送任务统一接口
  266 + * \param request 请求发送的任务
  267 + * \param callback 任务发送后的回调地址
  268 + */
  269 +- (BOOL)sendAPIRequest:(TCAPIRequest *)request callback:(id<TCAPIRequestDelegate>)callback;
  270 +
  271 +- (NSString *)getUserOpenID;
  272 +
  273 +@end
  274 +
  275 +#pragma mark - TencentLoginDelegate(授权登录回调协议)
  276 +
  277 +/**
  278 + * \brief TencentLoginDelegate iOS Open SDK 1.3 API回调协议
  279 + *
  280 + * 第三方应用实现登录的回调协议
  281 + */
  282 +@protocol TencentLoginDelegate <NSObject>
  283 +
  284 +@required
  285 +
  286 +/**
  287 + * 登录成功后的回调
  288 + */
  289 +- (void)tencentDidLogin;
  290 +
  291 +/**
  292 + * 登录失败后的回调
  293 + * \param cancelled 代表用户是否主动退出登录
  294 + */
  295 +- (void)tencentDidNotLogin:(BOOL)cancelled;
  296 +
  297 +/**
  298 + * 登录时网络有问题的回调
  299 + */
  300 +- (void)tencentDidNotNetWork;
  301 +
  302 +@optional
  303 +/**
  304 + * 登录时权限信息的获得
  305 + */
  306 +- (NSArray *)getAuthorizedPermissions:(NSArray *)permissions withExtraParams:(NSDictionary *)extraParams;
  307 +
  308 +@end
  309 +
  310 +#pragma mark - TencentSessionDelegate(开放接口回调协议)
  311 +
  312 +/**
  313 + * \brief TencentSessionDelegate iOS Open SDK 1.3 API回调协议
  314 + *
  315 + * 第三方应用需要实现每条需要调用的API的回调协议
  316 + */
  317 +@protocol TencentSessionDelegate<NSObject, TencentLoginDelegate,
  318 + TencentWebViewDelegate>
  319 +
  320 +@optional
  321 +
  322 +/**
  323 + * 退出登录的回调
  324 + */
  325 +- (void)tencentDidLogout;
  326 +
  327 +/**
  328 + * 因用户未授予相应权限而需要执行增量授权。在用户调用某个api接口时,如果服务器返回操作未被授权,则触发该回调协议接口,由第三方决定是否跳转到增量授权页面,让用户重新授权。
  329 + * \param tencentOAuth 登录授权对象。
  330 + * \param permissions 需增量授权的权限列表。
  331 + * \return 是否仍然回调返回原始的api请求结果。
  332 + * \note 不实现该协议接口则默认为不开启增量授权流程。若需要增量授权请调用\ref TencentOAuth#incrAuthWithPermissions: \n注意:增量授权时用户可能会修改登录的帐号
  333 + */
  334 +- (BOOL)tencentNeedPerformIncrAuth:(TencentOAuth *)tencentOAuth withPermissions:(NSArray *)permissions;
  335 +
  336 +/**
  337 + * [该逻辑未实现]因token失效而需要执行重新登录授权。在用户调用某个api接口时,如果服务器返回token失效,则触发该回调协议接口,由第三方决定是否跳转到登录授权页面,让用户重新授权。
  338 + * \param tencentOAuth 登录授权对象。
  339 + * \return 是否仍然回调返回原始的api请求结果。
  340 + * \note 不实现该协议接口则默认为不开启重新登录授权流程。若需要重新登录授权请调用\ref TencentOAuth#reauthorizeWithPermissions: \n注意:重新登录授权时用户可能会修改登录的帐号
  341 + */
  342 +- (BOOL)tencentNeedPerformReAuth:(TencentOAuth *)tencentOAuth;
  343 +
  344 +/**
  345 + * 用户通过增量授权流程重新授权登录,token及有效期限等信息已被更新。
  346 + * \param tencentOAuth token及有效期限等信息更新后的授权实例对象
  347 + * \note 第三方应用需更新已保存的token及有效期限等信息。
  348 + */
  349 +- (void)tencentDidUpdate:(TencentOAuth *)tencentOAuth;
  350 +
  351 +/**
  352 + * 用户增量授权过程中因取消或网络问题导致授权失败
  353 + * \param reason 授权失败原因,具体失败原因参见sdkdef.h文件中\ref UpdateFailType
  354 + */
  355 +- (void)tencentFailedUpdate:(UpdateFailType)reason;
  356 +
  357 +/**
  358 + * 获取用户个人信息回调
  359 + * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse
  360 + * \remarks 正确返回示例: \snippet example/getUserInfoResponse.exp success
  361 + * 错误返回示例: \snippet example/getUserInfoResponse.exp fail
  362 + */
  363 +- (void)getUserInfoResponse:(APIResponse*) response;
  364 +
  365 +
  366 +
  367 +/**
  368 + * 社交API统一回调接口
  369 + * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse
  370 + * \param message 响应的消息,目前支持‘SendStory’,‘AppInvitation’,‘AppChallenge’,‘AppGiftRequest’
  371 + */
  372 +- (void)responseDidReceived:(APIResponse*)response forMessage:(NSString *)message;
  373 +
  374 +/**
  375 + * post请求的上传进度
  376 + * \param tencentOAuth 返回回调的tencentOAuth对象
  377 + * \param bytesWritten 本次回调上传的数据字节数
  378 + * \param totalBytesWritten 总共已经上传的字节数
  379 + * \param totalBytesExpectedToWrite 总共需要上传的字节数
  380 + * \param userData 用户自定义数据
  381 + */
  382 +- (void)tencentOAuth:(TencentOAuth *)tencentOAuth didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite userData:(id)userData;
  383 +
  384 +
  385 +/**
  386 + * 通知第三方界面需要被关闭
  387 + * \param tencentOAuth 返回回调的tencentOAuth对象
  388 + * \param viewController 需要关闭的viewController
  389 + */
  390 +- (void)tencentOAuth:(TencentOAuth *)tencentOAuth doCloseViewController:(UIViewController *)viewController;
  391 +
  392 +@end
  393 +
  394 +#pragma mark - TencentWebViewDelegate(H5登录webview旋转方向回调)
  395 +
  396 +/**
  397 + * \brief TencentWebViewDelegate: H5登录webview旋转方向回调协议
  398 + *
  399 + * 第三方应用可以根据自己APP的旋转方向限制,通过此协议设置
  400 + */
  401 +@protocol TencentWebViewDelegate <NSObject>
  402 +@optional
  403 +- (BOOL) tencentWebViewShouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;
  404 +- (NSUInteger) tencentWebViewSupportedInterfaceOrientationsWithWebkit;
  405 +- (BOOL) tencentWebViewShouldAutorotateWithWebkit;
  406 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenAPI.framework/Headers/TencentOAuthObject.h 0 → 100644
  1 +///
  2 +/// \file TencentOAuthObject.h
  3 +/// 对开放接口的调用提供参数字典封装的辅助类
  4 +///
  5 +/// Created by Tencent on 12-12-28.
  6 +/// Copyright (c) 2012年 Tencent. All rights reserved.
  7 +///
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <UIKit/UIKit.h>
  11 +#import "sdkdef.h"
  12 +
  13 +
  14 +#pragma mark -
  15 +#pragma mark TCAddTopicDic
  16 +
  17 +/**
  18 + * \brief 发表说说的参数字典定义
  19 + *
  20 + * 可以直接填写相应参数后将对象当作参数传入API中
  21 + */
  22 +@interface TCAddTopicDic : TCAPIRequest
  23 +
  24 +/**
  25 + * 返回一个对象用来进行API参数的填充
  26 + * \note 不用释放,返回的对象是自动释放的
  27 + */
  28 ++ (TCAddTopicDic *) dictionary;
  29 +
  30 +/**
  31 + * 发布心情时引用的信息的类型。
  32 + * \note 1表示图片; 2表示网页; 3表示视频
  33 + */
  34 +@property (nonatomic, retain) TCOptionalStr paramRichtype;
  35 +
  36 +/**
  37 + * 发布心情时引用的信息的值。有richtype时必须有richval
  38 + *
  39 + * \note
  40 + * -# 当richtype为图片(即richtype为1,应用场景为发布心情时引用某张图片)时,\n
  41 + * richval需要传入该图片的相关参数。引用的图片来源分为两种:一种为网站图片,\n
  42 + * 一种为QQ空间相册中的某张图片。
  43 + * - 当引用的图片来自网站,richval包含下列参数的值:\n
  44 + * | 参数名称 | 是否必须 | 类型 | 描述 |
  45 + * | ------ | ------- | ------ | ----------------- |
  46 + * | url | 必须 | string | 网站图片的URL |
  47 + * | height | 必须 | string | 图片高度,单位: px |
  48 + * | width | 必须 | string | 图片宽度,单位: px |
  49 + * \n
  50 + * 输入时每个值中间用“&”分隔,如下所示:\n
  51 + * “url=http://qq.com/logo.png&width=25&height=21”
  52 + *
  53 + * - 当引用的图片来自QQ空间相册,richval包含下列参数的值。\n
  54 + * 这些值都需要通过调用相册OpenAPI来获得。参数意义如下:\n
  55 + * | 参数名称 | 是否必须 | 类型 | 描述 |
  56 + * | --------- | ------ | ------ | ---------------------------------- |
  57 + * | albumid | 必须 | string | 图片所属空间相册的ID |
  58 + * | pictureid | 必须 | string | 图片ID |
  59 + * | sloc | 必须 | string | 小图ID |
  60 + * | pictype | | string | 图片类型(JPG = 1;GIF = 2;PNG = 3) |
  61 + * | picheight | | string | 图片高度,单位: px |
  62 + * | picwidth | | string | 图片宽度,单位: px |
  63 + * 输入时每个值中间用逗号分隔,如下所示 :\n
  64 + * “albumid,pictureid,sloc,pictype,picheight,picwidth”
  65 + * -# 当richtype为网页(即richtype为2,应用场景为针对某网页发表评论)时,\n
  66 + * richval需要传入该网页的URL,发表为feeds时,后台会自动将该URL转换为短URL。
  67 + * -# 当richtype为视频(即richtype为3,应用场景为针对某视频发表评论)时,\n
  68 + * richval需要传入该视频的URL,发表为feeds时,后台会对该URL进行解析,\n
  69 + * 在feeds上显示播放器,视频源及缩略图。
  70 + */
  71 +@property (nonatomic, retain) TCOptionalStr paramRichval;
  72 +
  73 +/**
  74 + * 发布的心情的内容。
  75 + */
  76 +@property (nonatomic, retain) TCRequiredStr paramCon;
  77 +
  78 +/**
  79 + * 地址文。例如:广东省深圳市南山区高新科技园腾讯大厦。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。
  80 + */
  81 +@property (nonatomic, retain) TCOptionalStr paramLbs_nm;
  82 +
  83 +/**
  84 + * 经度。-180.0到+180.0,+表示东经。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。
  85 + */
  86 +@property (nonatomic, retain) TCOptionalStr paramLbs_x;
  87 +
  88 +/**
  89 + * 纬度。-90.0到+90.0,+表示北纬。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。
  90 + */
  91 +@property (nonatomic, retain) TCOptionalStr paramLbs_y;
  92 +
  93 +/**
  94 + * 第三方应用的平台类型。
  95 + * \note 1表示QQ空间; 2表示腾讯朋友; 3表示腾讯微博平台; 4表示腾讯Q+平台。
  96 + */
  97 +@property (nonatomic, retain) TCOptionalStr paramThirdSource;
  98 +@end
  99 +
  100 +
  101 +#pragma mark -
  102 +#pragma mark TCAddOneBlogDic
  103 +/**
  104 + * \brief 发表日志的参数字典定义
  105 + *
  106 + * 可以直接填写相应参数后将对象当作参数传入API中
  107 + */
  108 +@interface TCAddOneBlogDic : TCAPIRequest
  109 +
  110 +/**
  111 + * 返回一个对象用来进行API参数的填充
  112 + * \note 不用释放,返回的对象是自动释放的
  113 + */
  114 ++ (TCAddOneBlogDic *) dictionary;
  115 +
  116 +/**
  117 + * 日志标题(纯文本,最大长度128个字节,utf-8编码)。
  118 + */
  119 +@property (nonatomic, retain) TCRequiredStr paramTitle;
  120 +
  121 +/**
  122 + * content 文章内容(html数据,最大长度100*1024个字节,utf-8编码)
  123 + */
  124 +@property (nonatomic, retain) TCRequiredStr paramContent;
  125 +@end
  126 +
  127 +#pragma mark -
  128 +#pragma mark TCAddAlbumDic
  129 +/**
  130 + * \brief 创建空间相册的参数字典定义
  131 + *
  132 + * 可以直接填写相应参数后将对象当作参数传入API中
  133 + */
  134 +@interface TCAddAlbumDic : TCAPIRequest
  135 +
  136 +/**
  137 + * 返回一个对象用来进行API参数的填充
  138 + *
  139 + * \note 不用释放,返回的对象是自动释放的
  140 + */
  141 ++ (TCAddAlbumDic *) dictionary;
  142 +
  143 +/**
  144 + * albumname 必须 string 相册名 不能超过30个字符。
  145 + */
  146 +@property (nonatomic, retain) TCRequiredStr paramAlbumname;
  147 +
  148 +
  149 +/**
  150 + * albumdesc string 相册描述,不能超过200个字符。
  151 + */
  152 +@property (nonatomic, retain) TCOptionalStr paramAlbumdesc;
  153 +
  154 +/**
  155 + * priv string 相册权限
  156 + *
  157 + * \note 其取值含义为: 1=公开;3=只主人可见; 4=QQ好友可见; 5=问答加密。\n
  158 + * 不传则相册默认为公开权限。\n
  159 + * 如果priv取值为5,即相册是问答加密的,则必须包含问题和答案两个参数:\n
  160 + * - question: 问题,不能超过30个字符。
  161 + * - answer: 答案,不能超过30个字符。
  162 + */
  163 +@property (nonatomic, retain) TCOptionalStr paramPriv;
  164 +
  165 +/**
  166 + * question 问题,不能超过30个字符。
  167 + * \note 如果priv取值为5,必须包含这个参数:
  168 + **/
  169 +@property (nonatomic, retain) TCOptionalStr paramQuestion;
  170 +
  171 +/**
  172 + * answer 答案,不能超过30个字符。
  173 + * \note 如果priv取值为5,必须包含这个参数:
  174 + **/
  175 +@property (nonatomic, retain) TCOptionalStr paramAnswer;
  176 +
  177 +@end
  178 +
  179 +#pragma mark -
  180 +#pragma mark TCUploadPicDic
  181 +/**
  182 + * \brief 上传一张照片到QQ空间相册的参数字典定义
  183 + *
  184 + * 可以直接填写相应参数后将对象当作参数传入API中
  185 + */
  186 +@interface TCUploadPicDic : TCAPIRequest
  187 +
  188 +/**
  189 + * 返回一个对象用来进行API参数的填充
  190 + * \note 不用释放,返回的对象是自动释放的
  191 + */
  192 ++ (TCUploadPicDic *) dictionary;
  193 +
  194 +/**
  195 + * photodesc string 照片描述,注意照片描述不能超过200个字符。
  196 + */
  197 +@property (nonatomic, retain) TCOptionalStr paramPhotodesc;
  198 +/**
  199 + * string 照片的命名,必须以.jpg, .gif, .png, .jpeg, .bmp此类后缀结尾。
  200 + */
  201 +@property (nonatomic, retain) TCOptionalStr paramTitle;
  202 +
  203 +/**
  204 + * string 相册id。可不填,不填时则根据“mobile”标识选择默认上传的相册。
  205 + */
  206 +@property (nonatomic, retain) TCOptionalStr paramAlbumid;
  207 +
  208 +/**
  209 + * 标志位
  210 + *
  211 + * \note 0表示PC,1表示手机。用于当不传相册id时(即albumid为空时)控制是否传到手机相册。\n
  212 + * -# 如果传1,则当albumid为空时,图片会上传到手机相册;
  213 + * -# 如果不传或传0,则当albumid为空时,图片会上传到贴图相册;
  214 + */
  215 +@property (nonatomic, assign) TCOptionalStr paramMobile;
  216 +
  217 +/**
  218 + * x string 照片拍摄时的地理位置的经度。请使用原始数据(纯经纬度,0-360)。
  219 + */
  220 +@property (nonatomic, retain) TCOptionalStr paramX;
  221 +
  222 +/**
  223 + * y string 照片拍摄时的地理位置的纬度。请使用原始数据(纯经纬度,0-360)。
  224 + */
  225 +@property (nonatomic, retain) TCOptionalStr paramY;
  226 +
  227 +/**
  228 + * picture 必须 string 上传照片的文件名以及图片的内容(在发送请求时,图片内容以二进制数据流的形式发送,见下面的请求示例),注意照片名称不能超过30个字符。
  229 + */
  230 +@property (nonatomic, retain) TCRequiredImage paramPicture;
  231 +
  232 +/**
  233 + * needfeed int 标识上传照片时是否要发feed
  234 + * \note(0:不发feed; 1:发feed)。如果不填则默认为发feed。
  235 + */
  236 +@property (nonatomic, assign)TCOptionalStr paramNeedfeed;
  237 +
  238 +/**
  239 + * successnum int 批量上传照片时,已成功上传的张数,指明上传完成情况。
  240 + * \note 单张上传时可以不填,不填则默认为0。
  241 + */
  242 +@property (nonatomic, assign)TCOptionalStr paramSuccessnum;
  243 +
  244 +/**
  245 + * picnum int 批量上传照片的总张数,如果不填则默认为1。
  246 + * \note
  247 + * - 如果picnum=1,为单张上传,发送单张上传feed;
  248 + * - 如果picnum>1,为批量上传,发送批量上传feed。
  249 + * 批量上传方式:picnum为一次上传照片的张数,successnum初始值为0,每调用一次照片上传接口后递增其值。
  250 + * 信息中心中的feed表现形式:批量上传时最新的7张在feed中展示。其中最新上传的一张图片展示为大图,剩下的
  251 + * 六张按从新到旧的顺序展示为小图,其他图片不在feed中展示。
  252 + */
  253 +@property (nonatomic, assign)TCOptionalStr paramPicnum;
  254 +
  255 +@end
  256 +
  257 +#pragma mark -
  258 +#pragma mark TCAddShareDic
  259 +/**
  260 + * \brief 同步分享到QQ空间,腾讯微博的参数字典定义
  261 + *
  262 + * 可以直接填写相应参数后将对象当作参数传入API中
  263 + */
  264 +@interface TCAddShareDic : TCAPIRequest
  265 +
  266 +/**
  267 + * 返回一个对象用来进行API参数的填充
  268 + *
  269 + * \note 不用释放,返回的对象是自动释放的
  270 + */
  271 ++ (TCAddShareDic *) dictionary;
  272 +
  273 +/**
  274 + * title 必须 string feeds的标题 最长36个中文字,超出部分会被截断。
  275 + */
  276 +@property (nonatomic, retain) TCRequiredStr paramTitle;
  277 +
  278 +
  279 +/**
  280 + * url 必须 string 分享所在网页资源的链接,点击后跳转至第三方网页,对应上文接口说明中2的超链接。请以http://开头。
  281 + */
  282 +@property (nonatomic, retain) TCRequiredStr paramUrl;
  283 +
  284 +
  285 +/**
  286 + * comment string 用户评论内容,也叫发表分享时的分享理由 禁止使用系统生产的语句进行代替。
  287 + * 最长40个中文字,超出部分会被截断。
  288 + */
  289 +@property (nonatomic, retain) TCOptionalStr paramComment;
  290 +
  291 +
  292 +/**
  293 + * summary string 所分享的网页资源的摘要内容,或者是网页的概要描述 最长80个中文字,超出部分会被截断。
  294 + */
  295 +@property (nonatomic, retain) TCOptionalStr paramSummary;
  296 +
  297 +/**
  298 + * images string 所分享的网页资源的代表性图片链接",请以http://开头,长度限制255字符。多张图片以竖线(|)分隔,目前只有第一张图片有效,图片规格100*100为佳。
  299 + */
  300 +@property (nonatomic, retain) TCOptionalStr paramImages;
  301 +
  302 +/**
  303 + * type string 分享内容的类型。
  304 + *
  305 + * \note 4表示网页;5表示视频(type=5时,必须传入playurl)
  306 + */
  307 +@property (nonatomic, retain) TCOptionalStr paramType;
  308 +
  309 +/**
  310 + * playurl string 长度限制为256字节。仅在type=5的时候有效,表示视频的swf播放地址。
  311 + */
  312 +@property (nonatomic, retain) TCOptionalStr paramPlayurl;
  313 +
  314 +/**
  315 + * site 必须 string 分享的来源网站名称,请填写网站申请接入时注册的网站名称
  316 + */
  317 +@property (nonatomic, retain) TCRequiredStr paramSite;
  318 +
  319 +/**
  320 + * fromurl 必须 string 分享的来源网站对应的网站地址url 请以http://开头。
  321 + */
  322 +@property (nonatomic, retain) TCRequiredStr paramFromurl;
  323 +
  324 +/**
  325 + * nswb string 值为1时,表示分享不默认同步到微博,其他值或者不传此参数表示默认同步到微博。
  326 + */
  327 +@property (nonatomic, retain) TCOptionalStr paramNswb;
  328 +
  329 +@end
  330 +
  331 +#pragma mark -
  332 +#pragma mark TCCheckPageFansDic
  333 +/**
  334 + * \brief 验证是否认证空间粉丝tttyttyyyu的参数字典定义
  335 + *
  336 + * 可以直接填写相应参数后将对象当作参数传入API中
  337 + */
  338 +@interface TCCheckPageFansDic : TCAPIRequest
  339 +
  340 +/**
  341 + * 返回一个对象用来进行API参数的填充
  342 + *
  343 + * \note 不用释放,返回的对象是自动释放的
  344 + */
  345 ++ (TCCheckPageFansDic *) dictionary;
  346 +
  347 +/**
  348 + * 表示认证空间的QQ号码
  349 + */
  350 +@property (nonatomic, retain) TCRequiredStr paramPage_id;
  351 +@end
  352 +
  353 +#pragma mark -
  354 +#pragma mark TCSetUserHeadpic
  355 +/**
  356 + * \brief 设置用户头像
  357 + *
  358 + * 可以直接填写相应参数后将对象当作参数传入API中
  359 + */
  360 +@interface TCSetUserHeadpic : TCAPIRequest
  361 +
  362 +/**
  363 + * 返回一个对象用来进行API参数的填充
  364 + * \note 不用释放,返回的对象是自动释放的
  365 + */
  366 ++ (TCSetUserHeadpic *) dictionary;
  367 +
  368 +/**
  369 + * 设置用户头像的图片
  370 + */
  371 +@property (nonatomic, retain) TCRequiredImage paramImage;
  372 +
  373 +/**
  374 + * 图片的文件名
  375 + */
  376 +@property (nonatomic, retain) TCOptionalStr paramFileName;
  377 +@end
  378 +
  379 +#pragma mark -
  380 +#pragma mark TCListPhotoDic
  381 +
  382 +/**
  383 + * \brief 获取用户QQ空间相册中的照片列表
  384 + *
  385 + * 可以直接填写相应参数后将对象当作参数传入API中
  386 + */
  387 +@interface TCListPhotoDic : TCAPIRequest
  388 +
  389 +/**
  390 + * 返回一个对象用来进行API参数的填充
  391 + *
  392 + * \note 不用释放,返回的对象是自动释放的
  393 + */
  394 ++ (TCListPhotoDic *) dictionary;
  395 +
  396 +/**
  397 + * 表示要获取的照片列表所在的相册ID
  398 + */
  399 +@property (nonatomic, retain) TCRequiredStr paramAlbumid;
  400 +
  401 +@end
  402 +
  403 +#pragma mark -
  404 +#pragma mark TCMatchNickTipsDic
  405 +/**
  406 + * \brief 微博获取好友输入提示的参数字典定义
  407 + *
  408 + * 可以直接填写相应参数后将对象当作参数传入API中
  409 + */
  410 +@interface TCMatchNickTipsDic : TCAPIRequest
  411 +
  412 +/**
  413 + * 返回一个对象用来进行API参数的填充
  414 + *
  415 + * \note 不用释放,返回的对象是自动释放的
  416 + */
  417 ++ (TCMatchNickTipsDic *) dictionary;
  418 +
  419 +/**
  420 + * 匹配字符串(目前匹配范围为我收听的人)
  421 + */
  422 +@property (nonatomic, retain) TCRequiredStr paramMatch;
  423 +
  424 +/**
  425 + * 请求个数(1-10)
  426 + */
  427 +@property (nonatomic, retain) TCRequiredStr paramReqnum;
  428 +
  429 +@end
  430 +
  431 +
  432 +#pragma mark -
  433 +#pragma mark TCGetIntimateFriendsDic
  434 +/**
  435 + * \brief 微博获取最近联系人列表的参数字典定义
  436 + *
  437 + * 可以直接填写相应参数后将对象当作参数传入API中
  438 + */
  439 +@interface TCGetIntimateFriendsDic : TCAPIRequest
  440 +
  441 +/**
  442 + * 返回一个对象用来进行API参数的填充
  443 + *
  444 + * \note 不用释放,返回的对象是自动释放的
  445 + */
  446 ++ (TCGetIntimateFriendsDic *) dictionary;
  447 +
  448 +/**
  449 + * 请求个数(1-20)
  450 + */
  451 +@property (nonatomic, retain) TCRequiredStr paramReqnum;
  452 +
  453 +@end
  454 +
  455 +#pragma mark -
  456 +#pragma mark TCSendStoryDic
  457 +/**
  458 + * \brief QQ空间定向分享的参数字典定义
  459 + *
  460 + * 该分享支持@到指定好友,最多支持10个好友。
  461 + * 其中第三方应用可预传最多5个指定好友的openid,其余好友由用户自行选择。
  462 + * 该分享形式仅提供跳QZone分享和本地Html5分享两种形式。
  463 + * sendStroy不支持userData参数
  464 + */
  465 +@interface TCSendStoryDic : TCAPIRequest
  466 +
  467 +/**
  468 + * 返回一个对象用来进行API参数的填充
  469 + *
  470 + * \note 不用释放,返回的对象是自动释放的
  471 + */
  472 ++ (TCSendStoryDic *) dictionary;
  473 +
  474 +/**
  475 + * 分享的标题
  476 + */
  477 +@property (nonatomic, retain) TCRequiredStr paramTitle;
  478 +
  479 +/**
  480 + * 故事摘要,最多不超过50个汉字,可以为空
  481 + */
  482 +@property (nonatomic, retain) TCOptionalStr paramSummary;
  483 +
  484 +/**
  485 + * 默认展示在输入框里的分享理由,最多120个汉字,可以为空
  486 + */
  487 +@property (nonatomic, retain) TCOptionalStr paramDescription;
  488 +
  489 +/**
  490 + * 图片url
  491 + */
  492 +@property (nonatomic, retain) TCOptionalStr paramPics;
  493 +
  494 +/**
  495 + * 如果不填,则默认为"进入应用"
  496 + */
  497 +@property (nonatomic, retain) TCRequiredStr paramAct;
  498 +
  499 +/**
  500 + * 点击分享的Url
  501 + */
  502 +@property (nonatomic, retain) TCOptionalStr paramShareUrl;
  503 +
  504 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenAPI.framework/Headers/sdkdef.h 0 → 100644
  1 +///
  2 +/// \file sdkdef.h
  3 +/// \brief SDK中相关常量定义
  4 +///
  5 +/// Created by Tencent on 12-12-25.
  6 +/// Copyright (c) 2012年 Tencent. All rights reserved.
  7 +///
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <UIKit/UIKit.h>
  11 +
  12 +/**
  13 + * \brief 设置sdk的log等级
  14 + */
  15 +typedef enum {
  16 + TCOLogLevel_Disabled = -1, // 关闭所有log
  17 + TCOLogLevel_Error = 0,
  18 + TCOLogLevel_Warning,
  19 + TCOLogLevel_Info,
  20 + TCOLogLevel_Debug,
  21 +} TCOLogLevel;
  22 +
  23 +/**
  24 + * \brief 手机qq的当前版本
  25 + */
  26 +typedef enum QQVersion
  27 +{
  28 + kQQUninstall,
  29 + kQQVersion3_0,
  30 + kQQVersion4_0, //支持sso登陆
  31 + kQQVersion4_2_1, //ios7兼容
  32 + kQQVersion4_5, //4.5版本,wpa会话
  33 + kQQVersion4_6, //4.6版本,sso登陆信令通道切换
  34 + kQQVersion4_7, //4.7版本 不确定新支持了什么样的属性
  35 +} QQVersion;
  36 +
  37 +/**
  38 + * \brief APIResponse.retCode可能的枚举常量
  39 + */
  40 +typedef enum
  41 +{
  42 + URLREQUEST_SUCCEED = 0, /**< 网络请求成功发送至服务器,并且服务器返回数据格式正确
  43 + * \note 这里包括所请求业务操作失败的情况,例如没有授权等原因导致
  44 + */
  45 +
  46 + URLREQUEST_FAILED = 1, /**< 网络异常,或服务器返回的数据格式不正确导致无法解析 */
  47 +} REPONSE_RESULT;
  48 +
  49 +/**
  50 + * \brief 增量授权失败原因
  51 + *
  52 + * \note 增量授权失败不影响原token的有效性(原token已失效的情况除外)
  53 + */
  54 +typedef enum
  55 +{
  56 + kUpdateFailUnknown = 1, ///< 未知原因
  57 + kUpdateFailUserCancel, ///< 用户取消
  58 + kUpdateFailNetwork, ///< 网络问题
  59 +} UpdateFailType;
  60 +
  61 +/**
  62 + * \brief 封装服务器返回的结果
  63 + *
  64 + * APIResponse用于封装所有请求的返回结果,包括错误码、错误信息、原始返回数据以及返回数据的json格式字典
  65 + */
  66 +@interface APIResponse : NSObject<NSCoding> {
  67 + int _detailRetCode;
  68 + int _retCode;
  69 + int _seq;
  70 + NSString *_errorMsg;
  71 + NSDictionary *_jsonResponse;
  72 + NSString *_message;
  73 + id _userData;
  74 +}
  75 +
  76 +/**
  77 + * 新增的详细错误码\n
  78 + * detailRetCode主要用于区分不同的错误情况,参见\ref OpenSDKError
  79 + */
  80 +@property (nonatomic, assign) int detailRetCode;
  81 +
  82 +/**
  83 + * 网络请求是否成功送达服务器,以及服务器返回的数据格式是否正确\n
  84 + * retCode具体取值可参考\ref REPONSE_RESULT
  85 + */
  86 +@property (nonatomic, assign) int retCode;
  87 +
  88 +/**
  89 + * 网络请求对应的递增序列号,方便内部管理
  90 + */
  91 +@property (nonatomic, assign) int seq;
  92 +
  93 +/**
  94 + * 错误提示语
  95 + */
  96 +@property (nonatomic, retain) NSString *errorMsg;
  97 +
  98 +/**
  99 + * 服务器返回数据的json格式字典\n
  100 + * 字典内具体参数的命名和含义请参考\ref api_spec
  101 + */
  102 +@property (nonatomic, retain) NSDictionary *jsonResponse;
  103 +
  104 +/**
  105 + * 服务器返回的原始数据字符串
  106 + */
  107 +@property (nonatomic, retain) NSString *message;
  108 +
  109 +/**
  110 + * 用户保留数据
  111 + */
  112 +@property (nonatomic, retain) id userData;
  113 +
  114 +@end
  115 +
  116 +
  117 +/**
  118 + * 用户自定义的保留字段
  119 + */
  120 +FOUNDATION_EXTERN NSString * const PARAM_USER_DATA;
  121 +
  122 +/**
  123 + * \name 应用邀请参数字段定义
  124 + */
  125 +///@{
  126 +
  127 +/** 应用邀请展示图片url的key */
  128 +FOUNDATION_EXTERN NSString * const PARAM_APP_ICON;
  129 +
  130 +/** 应用邀请描述文本的key */
  131 +FOUNDATION_EXTERN NSString * const PARAM_APP_DESC;
  132 +
  133 +/** 应用邀请好友列表的key */
  134 +FOUNDATION_EXTERN NSString * const PARAM_APP_INVITED_OPENIDS;
  135 +
  136 +///@}
  137 +
  138 +/**
  139 + * \name sendStory新分享参数字段定义
  140 + */
  141 +///@{
  142 +
  143 +/** 预填入接受人列表的key */
  144 +FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_RECEIVER;
  145 +
  146 +/** 分享feeds标题的key */
  147 +FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_TITLE;
  148 +
  149 +/** 分享feeds评论内容的key */
  150 +FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_COMMENT;
  151 +
  152 +/** 分享feeds摘要的key */
  153 +FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_SUMMARY;
  154 +
  155 +/** 分享feeds展示图片url的key */
  156 +FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_IMAGE;
  157 +
  158 +/** 分享feeds跳转链接url的key */
  159 +FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_URL;
  160 +
  161 +/** 分享feeds点击操作默认行为的key */
  162 +FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_ACT;
  163 +
  164 +///@}
  165 +
  166 +/**
  167 + * \name 设置头像参数字段定义
  168 + */
  169 +///@{
  170 +
  171 +/** 头像图片数据的key */
  172 +FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_PIC;
  173 +
  174 +/** 头像图片文件名的key */
  175 +FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_FILENAME;
  176 +
  177 +///@}
  178 +
  179 +/**
  180 + * \name 服务器返回数据的参数字段定义
  181 + */
  182 +///@{
  183 +
  184 +/** 服务器返回码的key */
  185 +FOUNDATION_EXTERN NSString * const PARAM_RETCODE;
  186 +
  187 +/** 服务器返回错误信息的key */
  188 +FOUNDATION_EXTERN NSString * const PARAM_MESSAGE;
  189 +
  190 +/** 服务器返回额外数据的key */
  191 +FOUNDATION_EXTERN NSString * const PARAM_DATA;
  192 +
  193 +///@}
  194 +
  195 +/**
  196 + * \name 错误信息相关常量定义
  197 + */
  198 +///@{
  199 +
  200 +/** 详细错误信息字典中额外信息的key */
  201 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyExtraInfo;
  202 +
  203 +/** 详细错误信息字典中返回码的key */
  204 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyRetCode;
  205 +
  206 +/** 详细错误信息字典中错误语句的key */
  207 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyMsg;
  208 +
  209 +/** 不支持的接口 */
  210 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnsupportedAPI;
  211 +
  212 +/** 操作成功 */
  213 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSuccess;
  214 +
  215 +/** 未知错误 */
  216 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnknown;
  217 +
  218 +/** 用户取消 */
  219 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserCancel;
  220 +
  221 +/** 请重新登录 */
  222 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgReLogin;
  223 +
  224 +/** 应用没有操作权限 */
  225 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgOperationDeny;
  226 +
  227 +/** 网络异常或没有网络 */
  228 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgNetwork;
  229 +
  230 +/** URL格式或协议错误 */
  231 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgURL;
  232 +
  233 +/** 解析数据出错 */
  234 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgDataParse;
  235 +
  236 +/** 传入参数有误 */
  237 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgParam;
  238 +
  239 +/** 连接超时 */
  240 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgTimeout;
  241 +
  242 +/** 安全问题 */
  243 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSecurity;
  244 +
  245 +/** 文件读写错误 */
  246 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgIO;
  247 +
  248 +/** 服务器端错误 */
  249 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgServer;
  250 +
  251 +/** 页面错误 */
  252 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgWebPage;
  253 +
  254 +/** 设置头像图片过大 */
  255 +FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserHeadPicLarge;
  256 +
  257 +///@}
  258 +
  259 +/**
  260 + * \brief SDK新增详细错误常量
  261 + */
  262 +typedef enum
  263 +{
  264 + kOpenSDKInvalid = -1, ///< 无效的错误码
  265 + kOpenSDKErrorUnsupportedAPI = -2, ///< 不支持的接口
  266 +
  267 + /**
  268 + * \name CommonErrorCode
  269 + * 公共错误码
  270 + */
  271 + ///@{
  272 + kOpenSDKErrorSuccess = 0, ///< 成功
  273 + kOpenSDKErrorUnknown, ///< 未知错误
  274 + kOpenSDKErrorUserCancel, ///< 用户取消
  275 + kOpenSDKErrorReLogin, ///< token无效或用户未授权相应权限需要重新登录
  276 + kOpenSDKErrorOperationDeny, ///< 第三方应用没有该api操作的权限
  277 + ///@}
  278 +
  279 + /**
  280 + * \name NetworkRelatedErrorCode
  281 + * 网络相关错误码
  282 + */
  283 + ///@{
  284 + kOpenSDKErrorNetwork, ///< 网络错误,网络不通或连接不到服务器
  285 + kOpenSDKErrorURL, ///< URL格式或协议错误
  286 + kOpenSDKErrorDataParse, ///< 数据解析错误,服务器返回的数据解析出错
  287 + kOpenSDKErrorParam, ///< 传入参数错误
  288 + kOpenSDKErrorConnTimeout, ///< http连接超时
  289 + kOpenSDKErrorSecurity, ///< 安全问题
  290 + kOpenSDKErrorIO, ///< 下载和文件IO错误
  291 + kOpenSDKErrorServer, ///< 服务器端错误
  292 + ///@}
  293 +
  294 + /**
  295 + * \name WebViewRelatedError
  296 + * webview特有错误
  297 + */
  298 + ///@{
  299 + kOpenSDKErrorWebPage, ///< 页面错误
  300 + ///@}
  301 +
  302 + /**
  303 + * \name SetUserHeadRelatedErrorCode
  304 + * 设置头像自定义错误码段
  305 + */
  306 + ///@{
  307 + kOpenSDKErrorUserHeadPicLarge = 0x010000, ///< 图片过大 设置头像自定义错误码
  308 + ///@}
  309 +} OpenSDKError;
  310 +
  311 +/**
  312 + * \name SDK版本(v1.3)支持的授权列表常量
  313 + */
  314 +///@{
  315 +
  316 +/** 发表一条说说到QQ空间(<b>需要申请权限</b>) */
  317 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_TOPIC;
  318 +
  319 +/** 发表一篇日志到QQ空间(<b>需要申请权限</b>) */
  320 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_ONE_BLOG;
  321 +
  322 +/** 创建一个QQ空间相册(<b>需要申请权限</b>) */
  323 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_ALBUM;
  324 +
  325 +/** 上传一张照片到QQ空间相册(<b>需要申请权限</b>) */
  326 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_UPLOAD_PIC;
  327 +
  328 +/** 获取用户QQ空间相册列表(<b>需要申请权限</b>) */
  329 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_LIST_ALBUM;
  330 +
  331 +/** 同步分享到QQ空间、腾讯微博 */
  332 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_SHARE;
  333 +
  334 +/** 验证是否认证空间粉丝 */
  335 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_CHECK_PAGE_FANS;
  336 +
  337 +/** 上传图片并发表消息到腾讯微博 */
  338 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_PIC_T;
  339 +
  340 +/** 删除一条微博信息 */
  341 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_DEL_T;
  342 +
  343 +/** 获取一条微博的转播或评论信息列表 */
  344 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_REPOST_LIST;
  345 +
  346 +/** 获取登录用户自己的详细信息 */
  347 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_INFO;
  348 +
  349 +/** 获取其他用户的详细信息 */
  350 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_OTHER_INFO;
  351 +
  352 +/** 获取登录用户的听众列表 */
  353 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_FANSLIST;
  354 +
  355 +/** 获取登录用户的收听列表 */
  356 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_IDOLLIST;
  357 +
  358 +/** 收听腾讯微博上的用户 */
  359 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_IDOL;
  360 +
  361 +/** 取消收听腾讯微博上的用户 */
  362 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_DEL_IDOL;
  363 +
  364 +/** 获取微博中最近at的好友 */
  365 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_INTIMATE_FRIENDS_WEIBO;
  366 +
  367 +/** 获取微博中匹配昵称的好友 */
  368 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_MATCH_NICK_TIPS_WEIBO;
  369 +
  370 +/** 获取会员用户基本信息 */
  371 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_INFO;
  372 +
  373 +/** 获取会员用户详细信息 */
  374 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_RICH_INFO;
  375 +
  376 +/** 获取用户信息 */
  377 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_USER_INFO;
  378 +
  379 +/** 移动端获取用户信息 */
  380 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_SIMPLE_USER_INFO;
  381 +
  382 +/** 微云上传图片 */
  383 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_UPLOAD_PIC;
  384 +
  385 +/** 微云下载图片 */
  386 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DOWNLOAD_PIC;
  387 +
  388 +/** 微云获得图片列表 */
  389 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_GET_PIC_LIST;
  390 +
  391 +/** 微云删除图片 */
  392 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DELETE_PIC;
  393 +
  394 +/** 微云获取缩略图 */
  395 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_GET_PIC_THUMB;
  396 +
  397 +/** 微云上传音乐 */
  398 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_UPLOAD_MUSIC;
  399 +
  400 +/** 微云下载音乐 */
  401 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DOWNLOAD_MUSIC;
  402 +
  403 +/** 微云获取音乐列表 */
  404 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_GET_MUSIC_LIST;
  405 +
  406 +/** 微云删除音乐 */
  407 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DELETE_MUSIC;
  408 +
  409 +/** 微云上传视频 */
  410 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_UPLOAD_VIDEO;
  411 +
  412 +/** 微云下载视频 */
  413 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DOWNLOAD_VIDEO;
  414 +
  415 +/** 微云获取视频列表 */
  416 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_GET_VIDEO_LIST;
  417 +
  418 +/** 微云删除视频 */
  419 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DELETE_VIDEO;
  420 +
  421 +/** 微云上传照片 */
  422 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_UPLOAD_PHOTO;
  423 +
  424 +/** 微云下载照片 */
  425 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DOWNLOAD_PHOTO;
  426 +
  427 +/** 微云获得照片列表 */
  428 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_GET_PHOTO_LIST;
  429 +
  430 +/** 微云删除照片 */
  431 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DELETE_PHOTO;
  432 +
  433 +/** 微云获取图片缩略图 */
  434 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_GET_PHOTO_THUMB;
  435 +
  436 +/** 微云检查记录 */
  437 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_CHECK_RECORD;
  438 +
  439 +/** 微云创建记录 */
  440 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_CREATE_RECORD;
  441 +
  442 +/** 微云删除记录 */
  443 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_DELETE_RECORD;
  444 +
  445 +/** 微云获取记录 */
  446 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_GET_RECORD;
  447 +
  448 +/** 微云修改记录 */
  449 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_MODIFY_RECORD;
  450 +
  451 +/** 微云获取所有记录列表 */
  452 +FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_WEIYUN_QUERY_ALL_RECORD;
  453 +///@}
  454 +
  455 +
  456 +/**
  457 + * \name CGI接口相关参数类型定义
  458 + */
  459 +///@{
  460 +
  461 +/** 必填的字符串类型参数 */
  462 +typedef NSString *TCRequiredStr;
  463 +
  464 +/** 必填的UIImage类型参数 */
  465 +typedef UIImage *TCRequiredImage;
  466 +
  467 +/** 必填的整型参数 */
  468 +typedef NSInteger TCRequiredInt;
  469 +
  470 +/** 必填的数字类型 */
  471 +typedef NSNumber *TCRequiredNumber;
  472 +
  473 +/** 必填的NSData参数 */
  474 +typedef NSData *TCRequiredData;
  475 +
  476 +/** 可选的字符串类型参数 */
  477 +typedef NSString *TCOptionalStr;
  478 +
  479 +/** 可选的UIImage类型参数 */
  480 +typedef UIImage *TCOptionalImage;
  481 +
  482 +/** 可选的整型参数 */
  483 +typedef NSInteger TCOptionalInt;
  484 +
  485 +/** 可选的数字类型 */
  486 +typedef NSNumber *TCOptionalNumber;
  487 +
  488 +/** 可选的不定类型参数 */
  489 +typedef id TCRequiredId;
  490 +///@}
  491 +
  492 +
  493 +/**
  494 + * \brief CGI请求的参数字典封装辅助基类
  495 + *
  496 + * 将相应属性的值以key-value的形式保存到参数字典中
  497 + */
  498 +@interface TCAPIRequest : NSMutableDictionary
  499 +
  500 +/** CGI请求的URL地址 */
  501 +@property (nonatomic, readonly) NSURL *apiURL;
  502 +
  503 +/** CGI请求方式:"GET","POST" */
  504 +@property (nonatomic, readonly) NSString *method;
  505 +
  506 +/**
  507 + * API参数中的保留字段,可以塞入任意字典支持的类型,再调用完成后会带回给调用方
  508 + */
  509 +@property (nonatomic, retain) TCRequiredId paramUserData;
  510 +
  511 +/**
  512 + * APIResponse,API的返回结果
  513 + */
  514 +@property (nonatomic, readonly) APIResponse *response;
  515 +
  516 +/** 取消相应的CGI请求任务 */
  517 +- (void)cancel;
  518 +
  519 +@end
  520 +
  521 +@protocol TCAPIRequestDelegate <NSObject>
  522 +@optional
  523 +- (void)cgiRequest:(TCAPIRequest *)request didResponse:(APIResponse *)response;
  524 +
  525 +@end
  526 +
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenAPI.framework/TencentOpenAPI 0 → 100644
No preview for this file type
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenApi_IOS_Bundle.bundle/Info.plist 0 → 100644
No preview for this file type
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenApi_IOS_Bundle.bundle/error.png 0 → 100644

2.37 KB

LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenApi_IOS_Bundle.bundle/local.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 +<meta http-equiv="X-UA-Compatible" content="IE=Edge">
  5 +<meta charset="UTF-8">
  6 +<title>社交渠道</title>
  7 +<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale = 1.0,user-scalable=no" />
  8 +<meta name="format-detection" content="telephone=no" />
  9 +<meta name="apple-mobile-web-app-capable" content="yes" />
  10 +<style>
  11 +*{margin:0;padding:0}
  12 +.header{text-align:center;height:44px;background:-webkit-gradient(linear,0 0,0 100%,from(#4c4c4c),to(#313131));border-top:#5b5b5b 1px solid;position:relative;line-height:44px}
  13 +.header h1{color:#fff;font-weight:bold;font-size:20px}
  14 +.header a{width:49px;height:29px;background-size:49px 29px;position:absolute;top:7px;display:block;text-indent:-999em;cursor:pointer}
  15 +.header .back{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEkAAAAsCAYAAAApSpU1AAAFgElEQVR42u2bSWgsRRjH40XEg3rwIujBg6KCp4CH7AnZ933f9z0hK7kk8RCEhCwEMTmID81C8JIVQRJEfGQ5PEwOnpKDh+T0nomCGngolvUrpsaeYWbSnel5ODOv4Jfp/mrpqv9UffV1TyciwqYUGRn5keRjydeS7yWPgogfJOuSVsnrEXYn2ei7ku+Sk5NFZWWlaG1tFd3d3aK/vz9o6OnpES0tLaKoqEjIsfwu6bNToDzJbU1NjRgbGxPDw8NiYGAgqATSDA4OitHRUXXsEGvJDoEqJX8zcxCG2dPR0SHa2tqCkvb2dtHZ2Sl6e3vFyMiIKCwsRKgufwTKlTxFIKYqF2G6Njc3Bz2MA7EQTY7xRvLafQR6X/JHY2OjaoxGm5qaQgrEYlXk5OQgVJtVgV6W/FRRUaEEorFQE8goVFlZGSI9sCrS5wUFBaKrq0s1wmwKZZgMcsz7VgQqyszMVA4apRsaGkKe8vJyRHpoVqA3JL/U1dUpH4TKz0VyFegFybfEDuxmVK6vrw8LHD7JlEjdubm5aktEIGZTuFBaWnq3SLLAB0TUennV1taGFSUlJb5FkpkvcvNHQRw1lbj9CCfMiPQJy4ytngrV1dXPDEKMxcVFsbe390yv605xcbF3kWRGDPdlCMQMqqqq8gsCz5ubG7G7u+tiRwhscHJyIi4uLlQ5nW5vb8XU1JTXOlagntV+O250H3oS6BXJz3h2nBeFeQTiL4hA4lPb6DxCIA6Qh21jY0OJ46kd8km6jhm4BvWs9tlxk+tRpAcsMxw1BYk67eL4+Fh1Wp/TceO5GbRIVupwDepZ7a9HkaShOC0tTTlqBCKYshtCCX28s7Mjrq6uxMLCgld4bGGsTx2SlWsiEvWs9pVbMBeRHFH1NQqyxFhugUYP2FeijKc6+hwBPCXsxjLu7ZghPz//P5F0VJ2Xl6d2MgoQSNnF0NCQmJ+fd6LteiYZ8zQHBwdqsMbyug5Jn5+fn6tlbKzLOXZjGepZ7Td6GEXqycrKUo4agYgP7GR7e9vlW3a3M4i5uTmnnftDnC12b23pc8pgcy9jrOupjBmcIsk/bxFVs8RYh3YLdNcAr6+v1Sfp6OhICXR2dqZEYgb+X0RiqW2mpKSoDAKoQKEHqM8RCBvH6+vrShidODfThhbAvQx2X2XMwC5vXG6vSs5TU1NVABUo9AA5np2dVceTk5POfGaSTswmdllfbQACaBE02mYsg91qfx2Pb112tw8lf+KbiA8CwdbWlhogx3qpcYxQl5eXKm9tbU3BrMJGnrc2YH9/3ymKEey6DOfUs9rf7Oxsj3FSdVxcnIoPAoEeIMd0fHV11WlDsImJCWdZjhEKu7c2zKJFstpfJoy3iPvThIQEFSPYDd8uaXx83GnTQhHhu5fnh8Ll5WUXmxbJynW1SFb760skHpEcJSUlKe9uB319feL09FQNTn+ylDY3N50g1szMjEeor9ui7H0S9az2m2f6vp4CvCl5zI6Hh/eXpaUl1dGVlRV1Pj09LQ4PD112M1+J8rotLRI2s+gvxGq/MzIy7nyelMTjEtTEy/sLnfWV5wv3sgzYyrX5cnxd3xvp6emmHt+OxsbGKi8fjpgVSQWa7Hg4sXCDJyJmfy1RgWZiYqJyZOEEwbWVHydVoMmLWjizcIGNy7RIDqGqoqOjn4tkQqjPYmJilEMLB1g5ll6YcIj0kuRHHDlOLdTBD8vxfnGfl7jekfzGrUuoi8SqkWNtue/rgASaT1GaHSAU4bZMjvEJP7H5895kueSv+Ph45eBCjaioKERqsuMN3HTeeyYqDxVxmEEOgebtfJf7bcmu5B9CBJw6syvYoN8OcX7lPwMiApFkw+9JhiRfSb5h6wwyvpQ0evJB/wIFDhaTvqlwnwAAAABJRU5ErkJggg==);left:5px}
  16 +</style>
  17 +</head>
  18 +<body>
  19 +<div class="container" id="container">
  20 + <div class="header">
  21 + <h1 id="title"></h1>
  22 + <a href="javascript:void(0)" class="back" id="cancel">返回</a>
  23 + <a href="javascript:void(0)" style="display:none" id="confirm"></a>
  24 + </div>
  25 + <div id="main"></div>
  26 +</div>
  27 +<script>
  28 +(function () {
  29 + try {
  30 + document.domain = "qq.com";
  31 + } catch (_) {
  32 + alert("invalid domain");
  33 + }
  34 + function getParam(name) {
  35 + var re = new RegExp("(?:\\?|#|&)" + name + "=([^&]*)(?:$|&|#)", "i"), m = re.exec(window.location.href);
  36 + var ret = m ? m[1] : "";
  37 + ret = ret.replace(/[+]/ig, "%20");
  38 + return ret;
  39 + }
  40 + var iface = getParam("iface");
  41 + switch (iface) {
  42 + case "AppChallenge":
  43 + case "AppInvitation":
  44 + case "AppGiftRequest":
  45 + case "SendStory": {
  46 + var appid = getParam("oauth_consumer_key"), type = getParam("type");
  47 + var url = "tencent" + appid + "://" + iface + "/cancel";
  48 + document.getElementById("cancel").addEventListener("click", function () {
  49 + setTimeout(function () {
  50 + window.open(url, "_self");
  51 + }, 0);
  52 + }, false);
  53 + document.getElementById("title").innerHTML = {
  54 + AppChallenge : type == "pk" ? "发送挑战" : "发送炫耀",
  55 + AppInvitation : "发送应用邀请",
  56 + AppGiftRequest : type == "request" ? "发送应用请求" : "发送免费礼物",
  57 + SendStory : "发送分享"
  58 + }[iface];
  59 + document.write('<script type="text/javascript" src="http://qzonestyle.gtimg.cn/open/mobile/' + {
  60 + AppChallenge : "brag_ios/js/sdk_brag.js",
  61 + AppInvitation : "invite_ios/js/sdk_invite.js",
  62 + AppGiftRequest : "request_ios/js/sdk_request.js",
  63 + SendStory : "story_ios/js/sdk_story.js"
  64 + }[iface] + '"><\/script>');
  65 + break;
  66 + }
  67 + default:
  68 + return;
  69 + }
  70 +})();
  71 +</script>
  72 +</body>
  73 +</html>
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenApi_IOS_Bundle.bundle/qqicon.png 0 → 100644

2.64 KB

LiveVideoCloud/CNLiveShareSDK/SDK/QQSDK/TencentOpenApi_IOS_Bundle.bundle/success.png 0 → 100644

2.55 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBHttpRequest+WeiboGame.h 0 → 100755
  1 +//
  2 +// WBHttpRequest+WeiboGame.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by insomnia on 15/3/11.
  6 +// Copyright (c) 2015年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import "WBHttpRequest.h"
  10 +
  11 +@interface WBHttpRequest (WeiboGame)
  12 +
  13 +/*!
  14 + @method
  15 +
  16 + @abstract
  17 + 新增游戏对象。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
  18 +
  19 + @param userID 当前授权用户的uid
  20 +
  21 + @param accessToken 当前授权用户的accessToken
  22 +
  23 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  24 +
  25 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  26 +
  27 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  28 + */
  29 ++ (WBHttpRequest *)addGameObject:(NSString*)userID
  30 + withAccessToken:(NSString*)accessToken
  31 + andOtherProperties:(NSDictionary*)otherProperties
  32 + queue:(NSOperationQueue*)queue
  33 + withCompletionHandler:(WBRequestHandler)handler;
  34 +
  35 +/*!
  36 + @method
  37 +
  38 + @abstract
  39 + 游戏成就对象入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
  40 +
  41 + @param userID 当前授权用户的uid
  42 +
  43 + @param accessToken 当前授权用户的accessToken
  44 +
  45 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  46 +
  47 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  48 +
  49 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  50 + */
  51 ++ (WBHttpRequest *)addGameAchievementObject:(NSString*)userID
  52 + withAccessToken:(NSString*)accessToken
  53 + andOtherProperties:(NSDictionary*)otherProperties
  54 + queue:(NSOperationQueue*)queue
  55 + withCompletionHandler:(WBRequestHandler)handler;
  56 +
  57 +/*!
  58 + @method
  59 +
  60 + @abstract
  61 + 用户获得游戏成就关系入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
  62 +
  63 + @param userID 当前授权用户的uid
  64 +
  65 + @param accessToken 当前授权用户的accessToken
  66 +
  67 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  68 +
  69 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  70 +
  71 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  72 + */
  73 ++ (WBHttpRequest *)addGameAchievementGain:(NSString*)userID
  74 + withAccessToken:(NSString*)accessToken
  75 + andOtherProperties:(NSDictionary*)otherProperties
  76 + queue:(NSOperationQueue*)queue
  77 + withCompletionHandler:(WBRequestHandler)handler;
  78 +
  79 +/*!
  80 + @method
  81 +
  82 + @abstract
  83 + 用户游戏得分关系入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
  84 +
  85 + @param userID 当前授权用户的uid
  86 +
  87 + @param accessToken 当前授权用户的accessToken
  88 +
  89 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  90 +
  91 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  92 +
  93 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  94 + */
  95 ++ (WBHttpRequest *)addGameScoreGain:(NSString*)userID
  96 + withAccessToken:(NSString*)accessToken
  97 + andOtherProperties:(NSDictionary*)otherProperties
  98 + queue:(NSOperationQueue*)queue
  99 + withCompletionHandler:(WBRequestHandler)handler;
  100 +
  101 +
  102 +/*!
  103 + @method
  104 +
  105 + @abstract
  106 + 读取玩家游戏分数。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
  107 +
  108 + @param userID 当前授权用户的uid
  109 +
  110 + @param accessToken 当前授权用户的accessToken
  111 +
  112 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  113 +
  114 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  115 +
  116 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  117 + */
  118 ++ (WBHttpRequest *)requestForGameScore:(NSString*)userID
  119 + withAccessToken:(NSString*)accessToken
  120 + andOtherProperties:(NSDictionary*)otherProperties
  121 + queue:(NSOperationQueue*)queue
  122 + withCompletionHandler:(WBRequestHandler)handler;
  123 +
  124 +/*!
  125 + @method
  126 +
  127 + @abstract
  128 + 读取玩家互粉好友游戏分数。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
  129 +
  130 + @param userID 当前授权用户的uid
  131 +
  132 + @param accessToken 当前授权用户的accessToken
  133 +
  134 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  135 +
  136 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  137 +
  138 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  139 + */
  140 ++ (WBHttpRequest *)requestForFriendsGameScore:(NSString*)userID
  141 + withAccessToken:(NSString*)accessToken
  142 + andOtherProperties:(NSDictionary*)otherProperties
  143 + queue:(NSOperationQueue*)queue
  144 + withCompletionHandler:(WBRequestHandler)handler;
  145 +
  146 +/*!
  147 + @method
  148 +
  149 + @abstract
  150 + 读取玩家获取成就列表。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
  151 +
  152 + @param userID 当前授权用户的uid
  153 +
  154 + @param accessToken 当前授权用户的accessToken
  155 +
  156 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  157 +
  158 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  159 +
  160 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  161 + */
  162 ++ (WBHttpRequest *)requestForGameAchievementGain:(NSString*)userID
  163 + withAccessToken:(NSString*)accessToken
  164 + andOtherProperties:(NSDictionary*)otherProperties
  165 + queue:(NSOperationQueue*)queue
  166 + withCompletionHandler:(WBRequestHandler)handler;
  167 +
  168 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBHttpRequest+WeiboShare.h 0 → 100755
  1 +//
  2 +// WBHttpRequest+WeiboShare.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by DannionQiu on 14/10/31.
  6 +// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import "WBHttpRequest.h"
  10 +
  11 +@class WBImageObject;
  12 +
  13 +@interface WBHttpRequest (WeiboShare)
  14 +
  15 +/*!
  16 + @method
  17 +
  18 + @abstract
  19 + 获得当前授权用户的微博id列表。
  20 +
  21 + @param userID 当前授权用户的uid
  22 +
  23 + @param accessToken 当前授权用户的accessToken
  24 +
  25 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  26 +
  27 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  28 +
  29 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  30 +*/
  31 ++ (WBHttpRequest *)requestForStatusIDsFromCurrentUser:(NSString*)userID
  32 + withAccessToken:(NSString*)accessToken
  33 + andOtherProperties:(NSDictionary*)otherProperties
  34 + queue:(NSOperationQueue*)queue
  35 + withCompletionHandler:(WBRequestHandler)handler;
  36 +
  37 +/*!
  38 + @method
  39 +
  40 + @abstract
  41 + 转发微博。转发微博id所对应的微博。
  42 +
  43 + @param statusID 微博id,微博的唯一标识符。
  44 +
  45 + @param text 添加的转发文本,内容不超过140个汉字,不填则默认为“转发微博”。
  46 +
  47 + @param accessToken 当前授权用户的accessToken
  48 +
  49 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  50 +
  51 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  52 +
  53 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  54 + */
  55 ++ (WBHttpRequest *)requestForRepostAStatus:(NSString*)statusID
  56 + repostText:(NSString*)text
  57 + withAccessToken:(NSString*)accessToken
  58 + andOtherProperties:(NSDictionary*)otherProperties
  59 + queue:(NSOperationQueue*)queue
  60 + withCompletionHandler:(WBRequestHandler)handler;
  61 +
  62 +/*!
  63 + @method
  64 +
  65 + @abstract
  66 + 发表一个微博(无图或者带一张图片的微博)。
  67 +
  68 + @param statusText 要发布的微博文本内容,内容不超过140个汉字。
  69 +
  70 + @param imageObject 要上传的图片,仅支持JPEG、GIF、PNG格式,图片大小小于5M。这个参数可为nil。由于只能传一张图片,若imageObject和url都有值,请看@caution。
  71 +
  72 + @param url 图片的URL地址,必须以http开头。这个参数可为nil,由于只能传一张图片,若imageObject和url都有值,请看@caution。
  73 +
  74 + @param accessToken 当前授权用户的accessToken
  75 +
  76 + @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
  77 +
  78 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  79 +
  80 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  81 +
  82 + @caution 注意,如果参数imageObject和url都有值,则发布带有imageObject所对应的图片,忽略url所对应的图片。
  83 + */
  84 ++ (WBHttpRequest *)requestForShareAStatus:(NSString*)statusText
  85 + contatinsAPicture:(WBImageObject*)imageObject
  86 + orPictureUrl:(NSString*)url
  87 + withAccessToken:(NSString*)accessToken
  88 + andOtherProperties:(NSDictionary*)otherProperties
  89 + queue:(NSOperationQueue*)queue
  90 + withCompletionHandler:(WBRequestHandler)handler;
  91 +
  92 +
  93 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBHttpRequest+WeiboToken.h 0 → 100755
  1 +//
  2 +// WBHttpRequest+WeiboToken.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by DannionQiu on 14/11/6.
  6 +// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import "WBHttpRequest.h"
  10 +
  11 +@interface WBHttpRequest (WeiboToken)
  12 +/*!
  13 + @method
  14 +
  15 + @abstract
  16 + 使用RefreshToken去换取新的身份凭证AccessToken.
  17 +
  18 + @discussion
  19 + 在SSO授权登录后,服务器会下发有效期为7天的refreshToken以及有效期为1天的AccessToken。
  20 + 当有效期为1天的AccessToken过期时,可以调用该接口带着refreshToken信息区换取新的AccessToken。
  21 + @param refreshToken refreshToken
  22 +
  23 + @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
  24 +
  25 + @param handler 完成请求后会回调handler,处理完成请求后的逻辑。
  26 + */
  27 ++ (WBHttpRequest *)requestForRenewAccessTokenWithRefreshToken:(NSString*)refreshToken
  28 + queue:(NSOperationQueue*)queue
  29 + withCompletionHandler:(WBRequestHandler)handler;
  30 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBHttpRequest+WeiboUser.h 0 → 100755
  1 +//
  2 +// WBHttpRequest+WeiboUser.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by DannionQiu on 14-9-23.
  6 +// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import "WBHttpRequest.h"
  10 +
  11 +@interface WBHttpRequest (WeiboUser)
  12 +
  13 +/*!
  14 + @method
  15 +
  16 + @abstract
  17 + Creates a request representing a Open API call to the "friendships/friends".
  18 +
  19 + @discussion
  20 + Simplifies preparing a request and sending request to retrieve the user's friends.
  21 +
  22 + A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  23 + user's friends.
  24 +
  25 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/en
  26 +
  27 + @param currentUserID should be the current User's UserID which has been authorized.
  28 +
  29 + @param accessToken The token string.
  30 +
  31 + @param otherProperties Any additional properties for the Open API Request.
  32 +
  33 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  34 +
  35 + @param handler the comletion block which will be executed after received response from Open API server.
  36 + */
  37 ++ (WBHttpRequest *)requestForFriendsListOfUser:(NSString*)currentUserID
  38 + withAccessToken:(NSString*)accessToken
  39 + andOtherProperties:(NSDictionary*)otherProperties
  40 + queue:(NSOperationQueue*)queue
  41 + withCompletionHandler:(WBRequestHandler)handler;
  42 +
  43 +/*!
  44 + @method
  45 +
  46 + @abstract
  47 + Creates a request representing a Open API call to the "friendships/friends/ids".
  48 +
  49 + @discussion
  50 + Simplifies preparing a request and sending request to retrieve the user's friends' UserID.
  51 +
  52 + A successful Open API call will return an NSDictionary of objects which contanis an array of NSString representing the
  53 + user's friends' UserID.
  54 +
  55 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/ids/en
  56 +
  57 + @param currentUserID should be the current User's UserID which has been authorized.
  58 +
  59 + @param accessToken The token string.
  60 +
  61 + @param otherProperties Any additional properties for the Open API Request.
  62 +
  63 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  64 +
  65 + @param handler the comletion block which will be executed after received response from Open API server.
  66 + */
  67 ++ (WBHttpRequest *)requestForFriendsUserIDListOfUser:(NSString*)currentUserID
  68 + withAccessToken:(NSString*)accessToken
  69 + andOtherProperties:(NSDictionary*)otherProperties
  70 + queue:(NSOperationQueue*)queue
  71 + withCompletionHandler:(WBRequestHandler)handler;
  72 +
  73 +
  74 +/*!
  75 + @method
  76 +
  77 + @abstract
  78 + Creates a request representing a Open API call to the "friendships/friends/in_common".
  79 +
  80 + @discussion
  81 + Simplifies preparing a request and sending request to retrieve the common friends list between two users..
  82 +
  83 + A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  84 + user's friends.
  85 +
  86 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/in_common/en
  87 +
  88 + @param currentUserID should be the current User's UserID which has been authorized.
  89 +
  90 + @param accessToken The token string.
  91 +
  92 + @param otherProperties Any additional properties for the Open API Request.
  93 +
  94 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  95 +
  96 + @param handler the comletion block which will be executed after received response from Open API server.
  97 + */
  98 ++ (WBHttpRequest *)requestForCommonFriendsListBetweenUser:(NSString*)currentUserID
  99 + andUser:(NSString*)anotherUserID
  100 + withAccessToken:(NSString*)accessToken
  101 + andOtherProperties:(NSDictionary*)otherProperties
  102 + queue:(NSOperationQueue*)queue
  103 + withCompletionHandler:(WBRequestHandler)handler;
  104 +
  105 +/*!
  106 + @method
  107 +
  108 + @abstract
  109 + Creates a request representing a Open API call to the "friendships/friends/bilateral".
  110 +
  111 + @discussion
  112 + Simplifies preparing a request and sending request to retrieve the list of the users that are following the specified user and are being followed by the specified user.
  113 +
  114 + A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  115 + users that are following the specified user and are being followed by the specified user.
  116 +
  117 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/bilateral/en
  118 +
  119 + @param currentUserID should be the current User's UserID which has been authorized.
  120 +
  121 + @param accessToken The token string.
  122 +
  123 + @param otherProperties Any additional properties for the Open API Request.
  124 +
  125 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  126 +
  127 + @param handler the comletion block which will be executed after received response from Open API server.
  128 + */
  129 ++ (WBHttpRequest *)requestForBilateralFriendsListOfUser:(NSString*)currentUserID
  130 + withAccessToken:(NSString*)accessToken
  131 + andOtherProperties:(NSDictionary*)otherProperties
  132 + queue:(NSOperationQueue*)queue
  133 + withCompletionHandler:(WBRequestHandler)handler;
  134 +
  135 +/*!
  136 + @method
  137 +
  138 + @abstract
  139 + Creates a request representing a Open API call to the "friendships/followers".
  140 +
  141 + @discussion
  142 + Simplifies preparing a request and sending request to retrieve the user's followers.
  143 +
  144 + A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
  145 + user's followers.
  146 +
  147 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/en
  148 +
  149 + @param currentUserID should be the current User's UserID which has been authorized.
  150 +
  151 + @param accessToken The token string.
  152 +
  153 + @param otherProperties Any additional properties for the Open API Request.
  154 +
  155 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  156 +
  157 + @param handler the comletion block which will be executed after received response from Open API server.
  158 + */
  159 ++ (WBHttpRequest *)requestForFollowersListOfUser:(NSString*)currentUserID
  160 + withAccessToken:(NSString*)accessToken
  161 + andOtherProperties:(NSDictionary*)otherProperties
  162 + queue:(NSOperationQueue*)queue
  163 + withCompletionHandler:(WBRequestHandler)handler;
  164 +
  165 +/*!
  166 + @method
  167 +
  168 + @abstract
  169 + Creates a request representing a Open API call to the "friendships/followers/ids".
  170 +
  171 + @discussion
  172 + Simplifies preparing a request and sending request to retrieve the user's followers' UserID.
  173 +
  174 + A successful Open API call will return an NSDictionary of objects which contanis an array of NSString representing the
  175 + user's followers' UserID.
  176 +
  177 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/ids/en
  178 +
  179 + @param currentUserID should be the current User's UserID which has been authorized.
  180 +
  181 + @param accessToken The token string.
  182 +
  183 + @param otherProperties Any additional properties for the Open API Request.
  184 +
  185 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  186 +
  187 + @param handler the comletion block which will be executed after received response from Open API server.
  188 + */
  189 ++ (WBHttpRequest *)requestForFollowersUserIDListOfUser:(NSString*)currentUserID
  190 + withAccessToken:(NSString*)accessToken
  191 + andOtherProperties:(NSDictionary*)otherProperties
  192 + queue:(NSOperationQueue*)queue
  193 + withCompletionHandler:(WBRequestHandler)handler;
  194 +
  195 +/*!
  196 + @method
  197 +
  198 + @abstract
  199 + Creates a request representing a Open API call to the "friendships/followers/active".
  200 +
  201 + @discussion
  202 + Simplifies preparing a request and sending request to retrieve the active(high quality) followers list of a user.
  203 +
  204 + A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the active(high quality) followers list of a user.
  205 +
  206 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/active/en
  207 +
  208 + @param currentUserID should be the current User's UserID which has been authorized.
  209 +
  210 + @param accessToken The token string.
  211 +
  212 + @param otherProperties Any additional properties for the Open API Request.
  213 +
  214 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  215 +
  216 + @param handler the comletion block which will be executed after received response from Open API server.
  217 + */
  218 ++ (WBHttpRequest *)requestForActiveFollowersListOfUser:(NSString*)currentUserID
  219 + withAccessToken:(NSString*)accessToken
  220 + andOtherProperties:(NSDictionary*)otherProperties
  221 + queue:(NSOperationQueue*)queue
  222 + withCompletionHandler:(WBRequestHandler)handler;
  223 +
  224 +/*!
  225 + @method
  226 +
  227 + @abstract
  228 + Creates a request representing a Open API call to the "friendships/friends_chain/followers".
  229 +
  230 + @discussion
  231 + Simplifies preparing a request and sending request to retrieve the users that are being followed by the authenticating user and are following the specified user.
  232 +
  233 + A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the users that are being followed by the authenticating user and are following the specified user.
  234 +
  235 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends_chain/followers/en
  236 +
  237 + @param currentUserID should be the current User's UserID which has been authorized.
  238 +
  239 + @param accessToken The token string.
  240 +
  241 + @param otherProperties Any additional properties for the Open API Request.
  242 +
  243 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  244 +
  245 + @param handler the comletion block which will be executed after received response from Open API server.
  246 + */
  247 ++ (WBHttpRequest *)requestForBilateralFollowersListOfUser:(NSString*)currentUserID
  248 + withAccessToken:(NSString*)accessToken
  249 + andOtherProperties:(NSDictionary*)otherProperties
  250 + queue:(NSOperationQueue*)queue
  251 + withCompletionHandler:(WBRequestHandler)handler;
  252 +
  253 +/*!
  254 + @method
  255 +
  256 + @abstract
  257 + Creates a request representing a Open API call to the "friendships/show".
  258 +
  259 + @discussion
  260 + Simplifies preparing a request and sending request to retrieve the relationship of two users.
  261 +
  262 + A successful Open API call will return an NSDictionary of objects which contanis the relationship of two users.
  263 +
  264 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/show
  265 +
  266 + @param targetUserID a User ID
  267 +
  268 + @param sourceUserID a User ID
  269 +
  270 + @param accessToken The token string.
  271 +
  272 + @param otherProperties Any additional properties for the Open API Request.
  273 +
  274 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  275 +
  276 + @param handler the comletion block which will be executed after received response from Open API server.
  277 + */
  278 ++ (WBHttpRequest *)requestForFriendshipDetailBetweenTargetUser:(NSString*)targetUserID
  279 + andSourceUser:(NSString*)sourceUserID
  280 + withAccessToken:(NSString*)accessToken
  281 + andOtherProperties:(NSDictionary*)otherProperties
  282 + queue:(NSOperationQueue*)queue
  283 + withCompletionHandler:(WBRequestHandler)handler;
  284 +
  285 +/*!
  286 + @method
  287 +
  288 + @abstract
  289 + Creates a request representing a Open API call to the "friendships/create".
  290 +
  291 + @discussion
  292 + Simplifies preparing a request and sending request to Follow a user.
  293 +
  294 + A successful Open API call will return an <WeiboUser> object representing the user to be followed.
  295 +
  296 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/create/en
  297 +
  298 + @param theUserToBeFollowed the userID of the user which you want to follow.
  299 +
  300 + @param accessToken The token string.
  301 +
  302 + @param otherProperties Any additional properties for the Open API Request.
  303 +
  304 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  305 +
  306 + @param handler the comletion block which will be executed after received response from Open API server.
  307 + */
  308 ++ (WBHttpRequest *)requestForFollowAUser:(NSString*)theUserToBeFollowed
  309 + withAccessToken:(NSString*)accessToken
  310 + andOtherProperties:(NSDictionary*)otherProperties
  311 + queue:(NSOperationQueue*)queue
  312 + withCompletionHandler:(WBRequestHandler)handler;
  313 +
  314 +/*!
  315 + @method
  316 +
  317 + @abstract
  318 + Creates a request representing a Open API call to the "friendships/destroy".
  319 +
  320 + @discussion
  321 + Simplifies preparing a request and sending request to cancel following a user.
  322 +
  323 + A successful Open API call will return an <WeiboUser> object representing the user to be followed.
  324 +
  325 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/destroy/en
  326 +
  327 + @param theUserThatYouDontLike the userID of the user which you want to cancel following.
  328 +
  329 + @param accessToken The token string.
  330 +
  331 + @param otherProperties Any additional properties for the Open API Request.
  332 +
  333 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  334 +
  335 + @param handler the comletion block which will be executed after received response from Open API server.
  336 + */
  337 ++ (WBHttpRequest *)requestForCancelFollowAUser:(NSString*)theUserThatYouDontLike
  338 + withAccessToken:(NSString*)accessToken
  339 + andOtherProperties:(NSDictionary*)otherProperties
  340 + queue:(NSOperationQueue*)queue
  341 + withCompletionHandler:(WBRequestHandler)handler;
  342 +
  343 +/*!
  344 + @method
  345 +
  346 + @abstract
  347 + Creates a request representing a Open API call to the "friendships/followers/destroy".
  348 +
  349 + @discussion
  350 + Simplifies preparing a request and sending request to remove a follower of the authenticating user.
  351 +
  352 + A successful Open API call will return an <WeiboUser> object representing the user to be followed.
  353 +
  354 + this API requires advanced level authorization. You can see more details about advanced level authorization in http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#scope
  355 +
  356 + You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/destroy/en
  357 +
  358 + @param theUserThatYouDontLike the userID of the follower which you want to remove.
  359 +
  360 + @param accessToken The token string.
  361 +
  362 + @param otherProperties Any additional properties for the Open API Request.
  363 +
  364 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  365 +
  366 + @param handler the comletion block which will be executed after received response from Open API server.
  367 + */
  368 ++ (WBHttpRequest *)requestForRemoveFollowerUser:(NSString*)theUserThatYouDontLike
  369 + withAccessToken:(NSString*)accessToken
  370 + andOtherProperties:(NSDictionary*)otherProperties
  371 + queue:(NSOperationQueue*)queue
  372 + withCompletionHandler:(WBRequestHandler)handler;
  373 +
  374 +/*!
  375 + @method
  376 +
  377 + @abstract
  378 + Creates a request representing a Open API call to the "messages/invite".
  379 +
  380 + @discussion
  381 + Simplifies preparing a request and sending request to send invitation to a bilateral friend of the authenticating user.
  382 +
  383 + A successful Open API call will return an NSDictionary of objects which contanis <WeiboUser> objects representing sender and receiver and other invitation details.
  384 +
  385 + You can see more details about this API in http://open.weibo.com/wiki/2/messages/invite
  386 +
  387 + @param theUserThatShouldBeYourBilateralFriend the userID of the follower which you want to remove.
  388 +
  389 + @param accessToken The token string.
  390 +
  391 + @param text The text content in your invitation message. should not be nil.
  392 +
  393 + @param url The url in your invitation message. can be nil.
  394 +
  395 + @param logoUrl The logoUrl in your invitation message. can be nil.
  396 +
  397 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  398 +
  399 + @param handler the comletion block which will be executed after received response from Open API server.
  400 + */
  401 ++ (WBHttpRequest *)requestForInviteBilateralFriend:(NSString*)theUserThatShouldBeYourBilateralFriend
  402 + withAccessToken:(NSString*)accessToken
  403 + inviteText:(NSString*)text
  404 + inviteUrl:(NSString*)url
  405 + inviteLogoUrl:(NSString*)logoUrl
  406 + queue:(NSOperationQueue*)queue
  407 + withCompletionHandler:(WBRequestHandler)handler;
  408 +
  409 +
  410 +/*!
  411 + @method
  412 +
  413 + @abstract
  414 + Creates a request representing a Open API call to the "users/show".
  415 +
  416 + @discussion
  417 + Simplifies preparing a request and sending request to retrieve user profile by user ID..
  418 +
  419 + A successful Open API call will return a <WeiboUser> object representing the user profile by user ID.
  420 +
  421 + You can see more details about this API in http://open.weibo.com/wiki/2/users/show/en
  422 +
  423 + @param aUserID a User ID.
  424 +
  425 + @param accessToken The token string.
  426 +
  427 + @param otherProperties Any additional properties for the Open API Request.
  428 +
  429 + @param queue specify the queue that you want to send request on, if this param is nil, the request will be start on MainQueue( [NSOperationQueue mainQueue] ).
  430 +
  431 + @param handler the comletion block which will be executed after received response from Open API server.
  432 + */
  433 ++ (WBHttpRequest *)requestForUserProfile:(NSString*)aUserID
  434 + withAccessToken:(NSString*)accessToken
  435 + andOtherProperties:(NSDictionary*)otherProperties
  436 + queue:(NSOperationQueue*)queue
  437 + withCompletionHandler:(WBRequestHandler)handler;
  438 +
  439 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBHttpRequest.h 0 → 100755
  1 +//
  2 +// WBHttpRequest.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by DannionQiu on 14-9-18.
  6 +// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +#import <UIKit/UIKit.h>
  11 +
  12 +#pragma mark - WBHttpRequest and WBHttpRequestDelegate
  13 +@class WBHttpRequest;
  14 +
  15 +/**
  16 + 接收并处理来自微博sdk对于网络请求接口的调用响应 以及openAPI
  17 + 如inviteFriend、logOutWithToken的请求
  18 + */
  19 +@protocol WBHttpRequestDelegate <NSObject>
  20 +
  21 +/**
  22 + 收到一个来自微博Http请求的响应
  23 +
  24 + @param response 具体的响应对象
  25 + */
  26 +@optional
  27 +- (void)request:(WBHttpRequest *)request didReceiveResponse:(NSURLResponse *)response;
  28 +
  29 +/**
  30 + 收到一个来自微博Http请求失败的响应
  31 +
  32 + @param error 错误信息
  33 + */
  34 +@optional
  35 +- (void)request:(WBHttpRequest *)request didFailWithError:(NSError *)error;
  36 +
  37 +/**
  38 + 收到一个来自微博Http请求的网络返回
  39 +
  40 + @param result 请求返回结果
  41 + */
  42 +@optional
  43 +- (void)request:(WBHttpRequest *)request didFinishLoadingWithResult:(NSString *)result;
  44 +
  45 +/**
  46 + 收到一个来自微博Http请求的网络返回
  47 +
  48 + @param data 请求返回结果
  49 + */
  50 +@optional
  51 +- (void)request:(WBHttpRequest *)request didFinishLoadingWithDataResult:(NSData *)data;
  52 +
  53 +/**
  54 + 收到快速SSO授权的重定向
  55 +
  56 + @param URI
  57 + */
  58 +@optional
  59 +- (void)request:(WBHttpRequest *)request didReciveRedirectResponseWithURI:(NSURL *)redirectUrl;
  60 +
  61 +@end
  62 +
  63 +
  64 +/**
  65 + 微博封装Http请求的消息结构
  66 +
  67 + */
  68 +@interface WBHttpRequest : NSObject
  69 +{
  70 + NSURLConnection *connection;
  71 + NSMutableData *responseData;
  72 +}
  73 +
  74 +/**
  75 + 用户自定义请求地址URL
  76 + */
  77 +@property (nonatomic, strong) NSString *url;
  78 +
  79 +/**
  80 + 用户自定义请求方式
  81 +
  82 + 支持"GET" "POST"
  83 + */
  84 +@property (nonatomic, strong) NSString *httpMethod;
  85 +
  86 +/**
  87 + 用户自定义请求参数字典
  88 + */
  89 +@property (nonatomic, strong) NSDictionary *params;
  90 +
  91 +/**
  92 + WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
  93 + */
  94 +@property (nonatomic, weak) id<WBHttpRequestDelegate> delegate;
  95 +
  96 +/**
  97 + 用户自定义TAG
  98 +
  99 + 用于区分回调Request
  100 + */
  101 +@property (nonatomic, strong) NSString* tag;
  102 +
  103 +/**
  104 + 统一HTTP请求接口
  105 + 调用此接口后,将发送一个HTTP网络请求
  106 + @param url 请求url地址
  107 + @param httpMethod 支持"GET" "POST"
  108 + @param params 向接口传递的参数结构
  109 + @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
  110 + @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
  111 + */
  112 ++ (WBHttpRequest *)requestWithURL:(NSString *)url
  113 + httpMethod:(NSString *)httpMethod
  114 + params:(NSDictionary *)params
  115 + delegate:(id<WBHttpRequestDelegate>)delegate
  116 + withTag:(NSString *)tag;
  117 +
  118 +/**
  119 + 统一微博Open API HTTP请求接口
  120 + 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api)
  121 + @param accessToken 应用获取到的accessToken,用于身份验证
  122 + @param url 请求url地址
  123 + @param httpMethod 支持"GET" "POST"
  124 + @param params 向接口传递的参数结构
  125 + @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
  126 + @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
  127 + */
  128 ++ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken
  129 + url:(NSString *)url
  130 + httpMethod:(NSString *)httpMethod
  131 + params:(NSDictionary *)params
  132 + delegate:(id<WBHttpRequestDelegate>)delegate
  133 + withTag:(NSString *)tag;
  134 +
  135 +
  136 +
  137 +/**
  138 + 取消网络请求接口
  139 + 调用此接口后,将取消当前网络请求,建议同时[WBHttpRequest setDelegate:nil];
  140 + 注意:该方法只对使用delegate的request方法有效。无法取消任何使用block的request的网络请求接口。
  141 + */
  142 +- (void)disconnect;
  143 +
  144 +#pragma mark - block extension
  145 +
  146 +typedef void (^WBRequestHandler)(WBHttpRequest *httpRequest,
  147 + id result,
  148 + NSError *error);
  149 +
  150 +/**
  151 + 统一微博Open API HTTP请求接口
  152 + 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api)
  153 + @param url 请求url地址
  154 + @param httpMethod 支持"GET" "POST"
  155 + @param params 向接口传递的参数结构
  156 + @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。
  157 + @param handler 接口请求返回调用的block方法
  158 + */
  159 ++ (WBHttpRequest *)requestWithURL:(NSString *)url
  160 + httpMethod:(NSString *)httpMethod
  161 + params:(NSDictionary *)params
  162 + queue:(NSOperationQueue*)queue
  163 + withCompletionHandler:(WBRequestHandler)handler;
  164 +
  165 +
  166 +/**
  167 + 统一HTTP请求接口
  168 + 调用此接口后,将发送一个HTTP网络请求
  169 + @param url 请求url地址
  170 + @param httpMethod 支持"GET" "POST"
  171 + @param params 向接口传递的参数结构
  172 + @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。
  173 + @param handler 接口请求返回调用的block方法
  174 + */
  175 ++ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken
  176 + url:(NSString *)url
  177 + httpMethod:(NSString *)httpMethod
  178 + params:(NSDictionary *)params
  179 + queue:(NSOperationQueue*)queue
  180 + withCompletionHandler:(WBRequestHandler)handler;
  181 +
  182 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBSDKBasicButton.h 0 → 100755
  1 +//
  2 +// WBSDKBasicButton.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by DannionQiu on 14/10/24.
  6 +// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +@class WBSDKBasicButton;
  12 +typedef void (^WBSDKButtonHandler)(WBSDKBasicButton *button,
  13 + BOOL isSuccess,
  14 + NSDictionary *resultDict);
  15 +
  16 +@interface WBSDKBasicButton : UIButton
  17 +
  18 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBSDKCommentButton.h 0 → 100755
  1 +//
  2 +// WBSDKCommentButton.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by DannionQiu on 14/10/26.
  6 +// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import "WBSDKBasicButton.h"
  10 +
  11 +@interface WBSDKCommentButton : WBSDKBasicButton
  12 +
  13 +/**
  14 + 初始化一个社会化评论按钮
  15 + @param frame 按钮的frame值
  16 + @param accessToken 用户授权后获取的Token
  17 + @param keyWord 社会化评论的热点词
  18 + @param urlString 社会化评论链接,可传空
  19 + @param category 领域ID, 此参数为必选参数。
  20 + @param handler 回调函数,当用户点击按钮,进行完与社会化评论组件相关的交互之后,回调的函数。
  21 + */
  22 +- (id)initWithFrame:(CGRect)frame
  23 + accessToken:(NSString*)accessToken
  24 + keyword:(NSString*)keyWord
  25 + urlString:(NSString*)urlString
  26 + category:(NSString*)category
  27 + completionHandler:(WBSDKButtonHandler)handler;
  28 +
  29 +@property (nonatomic, strong)NSString* keyWord;
  30 +@property (nonatomic, strong)NSString* accessToken;
  31 +@property (nonatomic, strong)NSString* urlString;
  32 +@property (nonatomic, strong)NSString* category;
  33 +
  34 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WBSDKRelationshipButton.h 0 → 100755
  1 +//
  2 +// WBSDKRelationshipButton.h
  3 +// WeiboSDK
  4 +//
  5 +// Created by DannionQiu on 14/10/26.
  6 +// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
  7 +//
  8 +
  9 +#import "WBSDKBasicButton.h"
  10 +
  11 +enum
  12 +{
  13 + WBSDKRelationshipButtonStateFollow,
  14 + WBSDKRelationshipButtonStateUnfollow
  15 +};
  16 +typedef NSUInteger WBSDKRelationshipButtonState;
  17 +
  18 +
  19 +
  20 +@interface WBSDKRelationshipButton : WBSDKBasicButton
  21 +
  22 +/**
  23 + 初始化一个关注组件按钮
  24 + @param frame 按钮的frame值
  25 + @param accessToken 用户授权后获取的Token
  26 + @param currentUserID 当前用户的uid值
  27 + @param followerUserID 希望当前用户加关注的用户uid值
  28 + @param handler 回调函数,当用户点击按钮,进行完关注组件相关的交互之后,回调的函数。
  29 + */
  30 +- (id)initWithFrame:(CGRect)frame
  31 + accessToken:(NSString*)accessToken
  32 + currentUser:(NSString*)currentUserID
  33 + followUser:(NSString*)followerUserID
  34 + completionHandler:(WBSDKButtonHandler)handler;
  35 +
  36 +@property (nonatomic, strong)NSString* accessToken;
  37 +@property (nonatomic, strong)NSString* currentUserID;
  38 +@property (nonatomic, strong)NSString* followUserID;
  39 +
  40 +
  41 +@property (nonatomic, assign)WBSDKRelationshipButtonState currentRelationShip;
  42 +
  43 +
  44 +/**
  45 + 获取最新的关注状态
  46 + 该方法会调用OpenApi,获取当前用户与目标用户之间的关注状态,并将按钮的状态改变为正确的状态。
  47 + */
  48 +- (void)checkCurrentRelationship;
  49 +
  50 +@end
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/alert_error_icon@2x.png 0 → 100755

342 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/alert_success_icon@2x.png 0 → 100755

419 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/close.png 0 → 100755

1.61 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/close@2x.png 0 → 100755

5.2 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_button_big_blue@2x.png 0 → 100755

351 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_button_big_blue_disable@2x.png 0 → 100755

396 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_button_big_blue_highlighted@2x.png 0 → 100755

395 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_button_white.png 0 → 100755

400 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_button_white@2x.png 0 → 100755

367 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_button_white_highlighted.png 0 → 100755

409 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png 0 → 100755

378 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/common_icon_arrow@2x.png 0 → 100755

193 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/compose_keyboardbutton_background.png 0 → 100755

473 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/compose_keyboardbutton_background@2x.png 0 → 100755

1.18 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/compose_toolbar_background.png 0 → 100755

284 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/compose_toolbar_background@2x.png 0 → 100755

943 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/empty_failed.png 0 → 100755

2.86 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/empty_failed@2x.png 0 → 100755

4.04 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/login_background@2x.png 0 → 100755

232 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/login_country_background@2x.png 0 → 100755

114 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/login_country_background_highlighted@2x.png 0 → 100755

114 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/navigationbar_background.png 0 → 100755

290 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/navigationbar_background@2x.png 0 → 100755

142 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/navigationbar_background_os7.png 0 → 100755

285 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/navigationbar_background_os7@2x.png 0 → 100755

138 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/progresshud_background@2x.png 0 → 100755

188 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/sdk_weibo_logo.png 0 → 100755

1.21 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/sdk_weibo_logo@2x.png 0 → 100755

2.6 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/sdk_weibo_logo@3x.png 0 → 100755

2.87 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention.png 0 → 100755

362 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention@2x.png 0 → 100755

1.07 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention@3x.png 0 → 100755

181 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention.png 0 → 100755

413 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention@2x.png 0 → 100755

1.29 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention@3x.png 0 → 100755

507 Bytes

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/verify_code_button@2x.png 0 → 100755

1.04 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/verify_code_button@3x.png 0 → 100755

1.88 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/verify_code_button_highlighted@2x.png 0 → 100755

1.04 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/images/verify_code_button_highlighted@3x.png 0 → 100755

1.64 KB

LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/others/countryList 0 → 100755
  1 +{"香港地区":{"code":"00852","rule":{"mcc":["454"]}},"台湾地区":{"code":"00886","rule":{"mcc":["466"]}},"澳门地区":{"code":"00853","rule":{"mcc":["455"]}},"日本":{"code":"0081","rule":{"mcc":["440","441"]}},"韩国":{"code":"0082","rule":{"mcc":["450"]}},"新加坡":{"code":"0065","rule":{"mcc":["525"]}},"马来西亚":{"code":"0060","rule":{"mcc":["502"]}},"美国":{"code":"001","rule":{"mcc":["310","311","316"]}},"加拿大":{"code":"001","rule":{"mcc":["302"]}},"澳大利亚":{"code":"0061","rule":{"mcc":["505"]}},"英国":{"code":"0044","rule":{"mcc":["234"]}},"法国":{"code":"0033","rule":{"mcc":["208"]}},"俄罗斯":{"code":"007","rule":{"mcc":["250"]}},"印度":{"code":"0091","rule":{"mcc":["404"]}},"泰国":{"code":"0066","rule":{"mcc":["520"]}},"德国":{"code":"0049","rule":{"mcc":["262"]}}}
0 2 \ No newline at end of file
... ...
LiveVideoCloud/CNLiveShareSDK/SDK/SinaSDK/WeiboSDK.bundle/others/mfp.cer 0 → 100755
No preview for this file type