Skip to content

Commit

Permalink
modify 升级QQ和微信SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
itlijunjie committed Jul 22, 2018
1 parent 02d9dde commit 9129ac7
Show file tree
Hide file tree
Showing 18 changed files with 291 additions and 631 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|
|0.0.3| 3.1.3 | 3.1.4 | 1.7.5 |
|0.0.4| 3.2.1 | 3.1.4 | 1.7.7 |
|0.0.5| 3.3.3 | 3.1.4 | 1.8.2 |

### 1. SDK功能
| 平台 | 分享 | 登录 | 支付 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,26 @@
*/
+ (QQApiSendResultCode)SendReqToQZone:(QQBaseReq *)req;

/**
向手Q 群部落发起分享请求
\note H5分享只支持单张网络图片的传递
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)SendReqToQQGroupTribe:(QQBaseReq *)req;

/**
向手Q发送应答消息
\param resp 应答消息
\return 应答发送结果码
*/
+ (QQApiSendResultCode)sendResp:(QQBaseResp *)resp;

/**
检测是否已安装QQ
\return 如果QQ已安装则返回YES,否则返回NO
\note SDK目前已经支持QQ、TIM授权登录及分享功能, 会按照QQ>TIM的顺序进行调用。
只要用户安装了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
第三方应用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
*/
+ (BOOL)isQQInstalled;

/**
检测是否已安装TIM
\return 如果TIM已安装则返回YES,否则返回NO
\note SDK目前已经支持QQ、TIM授权登录及分享功能, 会按照QQ>TIM的顺序进行调用。
只要用户安装了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
第三方应用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
*/
+ (BOOL)isTIMInstalled;

/**
批量检测QQ号码是否在线
*/
+ (void)getQQUinOnlineStatues:(NSArray *)QQUins delegate:(id<QQApiInterfaceDelegate>)delegate;

/**
检测QQ是否支持API调用
\return 如果当前安装QQ版本支持API调用则返回YES,否则返回NO
Expand All @@ -103,6 +91,18 @@
*/
+ (BOOL)isTIMSupportApi;

/**
检测是否支持分享
\return 如果当前已安装QQ且QQ版本支持API调用 或者 当前已安装TIM且TIM版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isSupportShareToQQ;

/**
检测是否支持分享到QQ结合版QZone
\return 如果当前已安装QQ且QQ版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isSupportPushToQZone;

/**
启动QQ
\return 成功返回YES,否则返回NO
Expand Down Expand Up @@ -130,5 +130,4 @@
\return iPhoneTIM下载地址
*/
+ (NSString *)getTIMInstallUrl;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@
typedef enum
{
EQQAPISENDSUCESS = 0,
EQQAPIQQNOTINSTALLED = 1,
EQQAPIQQNOTSUPPORTAPI = 2,
EQQAPIQQNOTINSTALLED = 1, //QQ未安装
EQQAPIQQNOTSUPPORTAPI = 2, // QQ api不支持
EQQAPIMESSAGETYPEINVALID = 3,
EQQAPIMESSAGECONTENTNULL = 4,
EQQAPIMESSAGECONTENTINVALID = 5,
EQQAPIAPPNOTREGISTED = 6,
EQQAPIAPPSHAREASYNC = 7,
EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW = 8,
EQQAPISENDFAILD = -1,
EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW = 8, //QQ api不支持 && SDK显示error提示(已废弃)
EQQAPIMESSAGEARKCONTENTNULL = 9, //ark内容为空
EQQAPISENDFAILD = -1, //发送失败
EQQAPISHAREDESTUNKNOWN = -2, //未指定分享到QQ或TIM
EQQAPITIMSENDFAILD = -3, //发送失败

EQQAPITIMNOTINSTALLED = 11, //TIM未安装
EQQAPITIMNOTSUPPORTAPI = 12, // TIM api不支持
//qzone分享不支持text类型分享
EQQAPIQZONENOTSUPPORTTEXT = 10000,
//qzone分享不支持image类型分享
EQQAPIQZONENOTSUPPORTIMAGE = 10001,
//当前QQ版本太低,需要更新至新版本才可以支持
EQQAPIVERSIONNEEDUPDATE = 10002,
ETIMAPIVERSIONNEEDUPDATE = 10004,

EQQAPIQZONENOTSUPPORTTEXT = 10000, //qzone分享不支持text类型分享
EQQAPIQZONENOTSUPPORTIMAGE = 10001, //qzone分享不支持image类型分享
EQQAPIVERSIONNEEDUPDATE = 10002, //当前QQ版本太低,需要更新至新版本才可以支持
ETIMAPIVERSIONNEEDUPDATE = 10004, //当前TIM版本太低,需要更新至新版本才可以支持
} QQApiSendResultCode;

#pragma mark - QQApiObject(分享对象类型)
Expand All @@ -47,11 +47,12 @@ enum
kQQAPICtrlFlagQQShare = 0x04,
kQQAPICtrlFlagQQShareFavorites = 0x08, //收藏
kQQAPICtrlFlagQQShareDataline = 0x10, //数据线
kQQAPICtrlFlagQQShareEnableArk = 0x20, //支持ARK
};

// 分享到QQ或TIM
typedef enum ShareDestType {
ShareDestTypeQQ,
ShareDestTypeQQ = 0,
ShareDestTypeTIM,
}ShareDestType;

Expand All @@ -63,7 +64,23 @@ __attribute__((visibility("default"))) @interface QQApiObject : NSObject
@property(nonatomic,retain) NSString* description; ///<简要描述,最长512个字符

@property (nonatomic, assign) uint64_t cflag;
@property (nonatomic, assign) ShareDestType shareDestType; //分享到QQ或TIM,必须指定
/*
* 分享到QQ/TIM
* SDK根据是否安装对应客户端进行判断,判断顺序:QQ > TIM
* 默认分享到QQ,如果QQ未安装检测TIM是否安装
*/
@property (nonatomic, assign) ShareDestType shareDestType;
@end

// ArkObject
/** \brief 支持Ark的根类。
*/
__attribute__((visibility("default"))) @interface ArkObject : NSObject
@property(nonatomic,retain) NSString* arkData; ///< 显示Ark所需的数据,json串,长度暂不限制
@property(nonatomic,assign) QQApiObject* qqApiObject; ///<原有老版本的QQApiObject

- (id)initWithData:(NSString *)arkData qqApiObject:(QQApiObject*)qqApiObject;
+ (id)objectWithData:(NSString *)arkData qqApiObject:(QQApiObject*)qqApiObject;
@end

// QQApiResultObject
Expand Down Expand Up @@ -195,37 +212,42 @@ __attribute__((visibility("default"))) @interface QQApiURLObject : QQApiObject
@interface QQApiImageArrayForQZoneObject : QQApiObject

@property(nonatomic,retain) NSArray* imageDataArray;///图片数组
@property(nonatomic,retain) NSDictionary* extMap; // 扩展字段

/**
初始化方法
@param imageDataArray 图片数组
@param title 写说说的内容,可以为空
@param extMap 扩展字段
*/
- (id)initWithImageArrayData:(NSArray*)imageDataArray title:(NSString*)title;
- (id)initWithImageArrayData:(NSArray*)imageDataArray title:(NSString*)title extMap:(NSDictionary *)extMap;

/**
helper方法获取一个autorelease的<code>QQApiExtendObject</code>对象
@param title 写说说的内容,可以为空
@param imageDataArray 发送的多张图片队列
@param extMap 扩展字段
@return
一个自动释放的<code>QQApiExtendObject</code>实例
*/
+ (id)objectWithimageDataArray:(NSArray*)imageDataArray title:(NSString*)title;
+ (id)objectWithimageDataArray:(NSArray*)imageDataArray title:(NSString*)title extMap:(NSDictionary *)extMap;

@end

// QQApiVideoForQZoneObject
/** @brief 视频对象
用于分享视频到空间,走写说说路径<code>QQApiObject</code>
assetURL可传ALAsset的ALAssetPropertyAssetURL,或者PHAsset的localIdentifier
@param extMap 扩展字段
*/
@interface QQApiVideoForQZoneObject : QQApiObject

@property(nonatomic, retain) NSString *assetURL;
@property(nonatomic,retain) NSDictionary* extMap; // 扩展字段

- (id)initWithAssetURL:(NSString*)assetURL title:(NSString*)title;
- (id)initWithAssetURL:(NSString*)assetURL title:(NSString*)title extMap:(NSDictionary *)extMap;

+ (id)objectWithAssetURL:(NSString*)assetURL title:(NSString*)title;
+ (id)objectWithAssetURL:(NSString*)assetURL title:(NSString*)title extMap:(NSDictionary *)extMap;

@end

Expand Down Expand Up @@ -256,23 +278,6 @@ __attribute__((visibility("default"))) @interface QQApiURLObject : QQApiObject

@end

// QQApiGroupTribeImageObject
/** @brief 群部落图片对象
用于分享图片内容的对象,是一个指定为图片类型的 可以指定一些其他的附加数据<code>QQApiExtendObject</code>
*/
@interface QQApiGroupTribeImageObject : QQApiImageObject
{
NSString *_bid;
NSString *_bname;
}
// 群部落id
@property (nonatomic, retain)NSString* bid;

// 群部落名称
@property (nonatomic, retain)NSString* bname;

@end


//QQApiFileObject
/** @brief 本地文件对象(暂只支持分享到手机QQ数据线功能)
Expand Down Expand Up @@ -375,17 +380,6 @@ __attribute__((visibility("default"))) @interface QQApiURLObject : QQApiObject

@end

// QQApiPayObject
/** \brief 支付对象
*/
@interface QQApiPayObject : QQApiObject
@property(nonatomic,retain)NSString* OrderNo; ///<支付订单号,必填
@property(nonatomic,retain)NSString* AppInfo; ///<支付来源信息,必填

-(id)initWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo; ///<初始化方法
+(id)objectWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo;///<工厂方法,获取一个QQApiPayObject对象.
@end

// QQApiCommonContentObject;
/** @brief 通用模板类型对象
用于分享一个固定显示模板的图文混排对象
Expand Down Expand Up @@ -419,15 +413,7 @@ __attribute__((visibility("default"))) @interface QQApiURLObject : QQApiObject
@property(nonatomic,retain) NSURL* target;///<广告目标链接
@end

// QQApiWPAObject
/** \brief 发起WPA对象
*/
@interface QQApiWPAObject : QQApiObject
@property(nonatomic,retain)NSString* uin; ///<想要对话的QQ号

-(id)initWithUin:(NSString*)uin; ///<初始化方法
+(id)objectWithUin:(NSString*)uin;///<工厂方法,获取一个QQApiWPAObject对象.
@end
#pragma mark - QQApiObject(关系链对象)

// QQApiAddFriendObject
/** \brief 添加好友
Expand Down Expand Up @@ -469,16 +455,6 @@ __attribute__((visibility("default"))) @interface QQApiURLObject : QQApiObject

@end

// QQApiGroupChatObject
/** \brief 发起群会话对象
*/
@interface QQApiGroupChatObject : QQApiObject
@property(nonatomic,retain)NSString* groupID; ///<想要对话的群号

-(id)initWithGroup:(NSString*)groupID; ///<初始化方法
+(id)objectWithGroup:(NSString*)groupID;///<工厂方法,获取一个QQApiGroupChatObject对象.
@end

#pragma mark - QQApi请求消息类型

/**
Expand All @@ -488,7 +464,8 @@ enum QQApiInterfaceReqType
{
EGETMESSAGEFROMQQREQTYPE = 0, ///< 手Q -> 第三方应用,请求第三方应用向手Q发送消息
ESENDMESSAGETOQQREQTYPE = 1, ///< 第三方应用 -> 手Q,第三方应用向手Q分享消息
ESHOWMESSAGEFROMQQREQTYPE = 2 ///< 手Q -> 第三方应用,请求第三方应用展现消息中的数据
ESHOWMESSAGEFROMQQREQTYPE = 2, ///< 手Q -> 第三方应用,请求第三方应用展现消息中的数据
ESENDMESSAGEARKTOQQREQTYPE = 3 ///< 第三方应用 -> 手Q,第三方应用向手Q分享Ark消息
};

/**
Expand Down Expand Up @@ -542,38 +519,28 @@ enum QQApiInterfaceRespType

@end

/**
GetMessageFromQQResp应答帮助类
*/
@interface GetMessageFromQQResp : QQBaseResp
@interface SendMessageToQQReq : QQBaseReq

/**
创建一个GetMessageFromQQResp应答实例
创建一个SendMessageToQQReq请求实例
\param message 具体分享消息实例
\return 新创建的GetMessageFromQQResp应答实例
*/
+ (GetMessageFromQQResp *)respWithContent:(QQApiObject *)message;

/** 具体分享消息 */
@property (nonatomic, retain) QQApiObject *message;

@end

/**
SendMessageToQQReq请求帮助类
\return 新创建的SendMessageToQQReq请求实例
*/
@interface SendMessageToQQReq : QQBaseReq
+ (SendMessageToQQReq *)reqWithContent:(QQApiObject *)message;

/**
创建一个SendMessageToQQReq请求实例
创建一个支持Ark的SendMessageToQQReq请求实例
\param message 具体分享消息实例
\return 新创建的SendMessageToQQReq请求实例
*/
+ (SendMessageToQQReq *)reqWithContent:(QQApiObject *)message;
+ (SendMessageToQQReq *)reqWithArkContent:(ArkObject *)message;

/** 具体分享消息 */
@property (nonatomic, retain) QQApiObject *message;

/** 支持Ark的具体分享消息 */
@property (nonatomic, retain) ArkObject *arkMessage;

@end

/**
Expand Down Expand Up @@ -609,19 +576,5 @@ enum QQApiInterfaceRespType

@end

/**
ShowMessageFromQQResp应答帮助类
*/
@interface ShowMessageFromQQResp : QQBaseResp

/**
创建一个ShowMessageFromQQResp应答实例
\param result 展现消息结果
\param errDesp 具体错误描述信息
\return 新创建的ShowMessageFromQQResp应答实例
*/
+ (ShowMessageFromQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp;

@end

#endif
Loading

0 comments on commit 9129ac7

Please sign in to comment.