Initial commit
@@ -0,0 +1,168 @@
|
||||
//
|
||||
// WBHttpRequest+WeiboGame.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by insomnia on 15/3/11.
|
||||
// Copyright (c) 2015年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WBHttpRequest.h"
|
||||
|
||||
@interface WBHttpRequest (WeiboGame)
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
新增游戏对象。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)addGameObject:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
游戏成就对象入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)addGameAchievementObject:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
用户获得游戏成就关系入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)addGameAchievementGain:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
用户游戏得分关系入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)addGameScoreGain:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
读取玩家游戏分数。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForGameScore:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
读取玩家互粉好友游戏分数。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForFriendsGameScore:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
读取玩家获取成就列表。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForGameAchievementGain:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// WBHttpRequest+WeiboShare.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14/10/31.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WBHttpRequest.h"
|
||||
|
||||
@class WBImageObject;
|
||||
|
||||
@interface WBHttpRequest (WeiboShare)
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
获得当前授权用户的微博id列表。
|
||||
|
||||
@param userID 当前授权用户的uid
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForStatusIDsFromCurrentUser:(NSString*)userID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
转发微博。转发微博id所对应的微博。
|
||||
|
||||
@param statusID 微博id,微博的唯一标识符。
|
||||
|
||||
@param text 添加的转发文本,内容不超过140个汉字,不填则默认为“转发微博”。
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForRepostAStatus:(NSString*)statusID
|
||||
repostText:(NSString*)text
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
发表一个微博(无图或者带一张图片的微博)。
|
||||
|
||||
@param statusText 要发布的微博文本内容,内容不超过140个汉字。
|
||||
|
||||
@param imageObject 要上传的图片,仅支持JPEG、GIF、PNG格式,图片大小小于5M。这个参数可为nil。由于只能传一张图片,若imageObject和url都有值,请看@caution。
|
||||
|
||||
@param url 图片的URL地址,必须以http开头。这个参数可为nil,由于只能传一张图片,若imageObject和url都有值,请看@caution。
|
||||
|
||||
@param accessToken 当前授权用户的accessToken
|
||||
|
||||
@param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
|
||||
@caution 注意,如果参数imageObject和url都有值,则发布带有imageObject所对应的图片,忽略url所对应的图片。
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForShareAStatus:(NSString*)statusText
|
||||
contatinsAPicture:(WBImageObject*)imageObject
|
||||
orPictureUrl:(NSString*)url
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// WBHttpRequest+WeiboToken.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14/11/6.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WBHttpRequest.h"
|
||||
|
||||
@interface WBHttpRequest (WeiboToken)
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
使用RefreshToken去换取新的身份凭证AccessToken.
|
||||
|
||||
@discussion
|
||||
在SSO授权登录后,服务器会下发有效期为7天的refreshToken以及有效期为1天的AccessToken。
|
||||
当有效期为1天的AccessToken过期时,可以调用该接口带着refreshToken信息区换取新的AccessToken。
|
||||
@param refreshToken refreshToken
|
||||
|
||||
@param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
|
||||
|
||||
@param handler 完成请求后会回调handler,处理完成请求后的逻辑。
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForRenewAccessTokenWithRefreshToken:(NSString*)refreshToken
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
@end
|
||||
@@ -0,0 +1,439 @@
|
||||
//
|
||||
// WBHttpRequest+WeiboUser.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14-9-23.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WBHttpRequest.h"
|
||||
|
||||
@interface WBHttpRequest (WeiboUser)
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/friends".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve the user's friends.
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
|
||||
user's friends.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForFriendsListOfUser:(NSString*)currentUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/friends/ids".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve the user's friends' UserID.
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis an array of NSString representing the
|
||||
user's friends' UserID.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/ids/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForFriendsUserIDListOfUser:(NSString*)currentUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/friends/in_common".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve the common friends list between two users..
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
|
||||
user's friends.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/in_common/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForCommonFriendsListBetweenUser:(NSString*)currentUserID
|
||||
andUser:(NSString*)anotherUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/friends/bilateral".
|
||||
|
||||
@discussion
|
||||
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.
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
|
||||
users that are following the specified user and are being followed by the specified user.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends/bilateral/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForBilateralFriendsListOfUser:(NSString*)currentUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/followers".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve the user's followers.
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis an array of <WeiboUser> objects representing the
|
||||
user's followers.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForFollowersListOfUser:(NSString*)currentUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/followers/ids".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve the user's followers' UserID.
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis an array of NSString representing the
|
||||
user's followers' UserID.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/ids/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForFollowersUserIDListOfUser:(NSString*)currentUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/followers/active".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve the active(high quality) followers list of a user.
|
||||
|
||||
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.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/active/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForActiveFollowersListOfUser:(NSString*)currentUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/friends_chain/followers".
|
||||
|
||||
@discussion
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/friends_chain/followers/en
|
||||
|
||||
@param currentUserID should be the current User's UserID which has been authorized.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForBilateralFollowersListOfUser:(NSString*)currentUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/show".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve the relationship of two users.
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis the relationship of two users.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/show
|
||||
|
||||
@param targetUserID a User ID
|
||||
|
||||
@param sourceUserID a User ID
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForFriendshipDetailBetweenTargetUser:(NSString*)targetUserID
|
||||
andSourceUser:(NSString*)sourceUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/create".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to Follow a user.
|
||||
|
||||
A successful Open API call will return an <WeiboUser> object representing the user to be followed.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/create/en
|
||||
|
||||
@param theUserToBeFollowed the userID of the user which you want to follow.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForFollowAUser:(NSString*)theUserToBeFollowed
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/destroy".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to cancel following a user.
|
||||
|
||||
A successful Open API call will return an <WeiboUser> object representing the user to be followed.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/destroy/en
|
||||
|
||||
@param theUserThatYouDontLike the userID of the user which you want to cancel following.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForCancelFollowAUser:(NSString*)theUserThatYouDontLike
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "friendships/followers/destroy".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to remove a follower of the authenticating user.
|
||||
|
||||
A successful Open API call will return an <WeiboUser> object representing the user to be followed.
|
||||
|
||||
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
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/friendships/followers/destroy/en
|
||||
|
||||
@param theUserThatYouDontLike the userID of the follower which you want to remove.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForRemoveFollowerUser:(NSString*)theUserThatYouDontLike
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "messages/invite".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to send invitation to a bilateral friend of the authenticating user.
|
||||
|
||||
A successful Open API call will return an NSDictionary of objects which contanis <WeiboUser> objects representing sender and receiver and other invitation details.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/messages/invite
|
||||
|
||||
@param theUserThatShouldBeYourBilateralFriend the userID of the follower which you want to remove.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param text The text content in your invitation message. should not be nil.
|
||||
|
||||
@param url The url in your invitation message. can be nil.
|
||||
|
||||
@param logoUrl The logoUrl in your invitation message. can be nil.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForInviteBilateralFriend:(NSString*)theUserThatShouldBeYourBilateralFriend
|
||||
withAccessToken:(NSString*)accessToken
|
||||
inviteText:(NSString*)text
|
||||
inviteUrl:(NSString*)url
|
||||
inviteLogoUrl:(NSString*)logoUrl
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
|
||||
/*!
|
||||
@method
|
||||
|
||||
@abstract
|
||||
Creates a request representing a Open API call to the "users/show".
|
||||
|
||||
@discussion
|
||||
Simplifies preparing a request and sending request to retrieve user profile by user ID..
|
||||
|
||||
A successful Open API call will return a <WeiboUser> object representing the user profile by user ID.
|
||||
|
||||
You can see more details about this API in http://open.weibo.com/wiki/2/users/show/en
|
||||
|
||||
@param aUserID a User ID.
|
||||
|
||||
@param accessToken The token string.
|
||||
|
||||
@param otherProperties Any additional properties for the Open API Request.
|
||||
|
||||
@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] ).
|
||||
|
||||
@param handler the comletion block which will be executed after received response from Open API server.
|
||||
*/
|
||||
+ (WBHttpRequest *)requestForUserProfile:(NSString*)aUserID
|
||||
withAccessToken:(NSString*)accessToken
|
||||
andOtherProperties:(NSDictionary*)otherProperties
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,182 @@
|
||||
//
|
||||
// WBHttpRequest.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14-9-18.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#pragma mark - WBHttpRequest and WBHttpRequestDelegate
|
||||
@class WBHttpRequest;
|
||||
|
||||
/**
|
||||
接收并处理来自微博sdk对于网络请求接口的调用响应 以及openAPI
|
||||
如inviteFriend、logOutWithToken的请求
|
||||
*/
|
||||
@protocol WBHttpRequestDelegate <NSObject>
|
||||
|
||||
/**
|
||||
收到一个来自微博Http请求的响应
|
||||
|
||||
@param response 具体的响应对象
|
||||
*/
|
||||
@optional
|
||||
- (void)request:(WBHttpRequest *)request didReceiveResponse:(NSURLResponse *)response;
|
||||
|
||||
/**
|
||||
收到一个来自微博Http请求失败的响应
|
||||
|
||||
@param error 错误信息
|
||||
*/
|
||||
@optional
|
||||
- (void)request:(WBHttpRequest *)request didFailWithError:(NSError *)error;
|
||||
|
||||
/**
|
||||
收到一个来自微博Http请求的网络返回
|
||||
|
||||
@param result 请求返回结果
|
||||
*/
|
||||
@optional
|
||||
- (void)request:(WBHttpRequest *)request didFinishLoadingWithResult:(NSString *)result;
|
||||
|
||||
/**
|
||||
收到一个来自微博Http请求的网络返回
|
||||
|
||||
@param data 请求返回结果
|
||||
*/
|
||||
@optional
|
||||
- (void)request:(WBHttpRequest *)request didFinishLoadingWithDataResult:(NSData *)data;
|
||||
|
||||
/**
|
||||
收到快速SSO授权的重定向
|
||||
|
||||
@param URI
|
||||
*/
|
||||
@optional
|
||||
- (void)request:(WBHttpRequest *)request didReciveRedirectResponseWithURI:(NSURL *)redirectUrl;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
微博封装Http请求的消息结构
|
||||
|
||||
*/
|
||||
@interface WBHttpRequest : NSObject
|
||||
{
|
||||
NSURLConnection *connection;
|
||||
NSMutableData *responseData;
|
||||
}
|
||||
|
||||
/**
|
||||
用户自定义请求地址URL
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *url;
|
||||
|
||||
/**
|
||||
用户自定义请求方式
|
||||
|
||||
支持"GET" "POST"
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *httpMethod;
|
||||
|
||||
/**
|
||||
用户自定义请求参数字典
|
||||
*/
|
||||
@property (nonatomic, strong) NSDictionary *params;
|
||||
|
||||
/**
|
||||
WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
|
||||
*/
|
||||
@property (nonatomic, weak) id<WBHttpRequestDelegate> delegate;
|
||||
|
||||
/**
|
||||
用户自定义TAG
|
||||
|
||||
用于区分回调Request
|
||||
*/
|
||||
@property (nonatomic, strong) NSString* tag;
|
||||
|
||||
/**
|
||||
统一HTTP请求接口
|
||||
调用此接口后,将发送一个HTTP网络请求
|
||||
@param url 请求url地址
|
||||
@param httpMethod 支持"GET" "POST"
|
||||
@param params 向接口传递的参数结构
|
||||
@param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
|
||||
@param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
|
||||
*/
|
||||
+ (WBHttpRequest *)requestWithURL:(NSString *)url
|
||||
httpMethod:(NSString *)httpMethod
|
||||
params:(NSDictionary *)params
|
||||
delegate:(id<WBHttpRequestDelegate>)delegate
|
||||
withTag:(NSString *)tag;
|
||||
|
||||
/**
|
||||
统一微博Open API HTTP请求接口
|
||||
调用此接口后,将发送一个HTTP网络请求(用于访问微博open api)
|
||||
@param accessToken 应用获取到的accessToken,用于身份验证
|
||||
@param url 请求url地址
|
||||
@param httpMethod 支持"GET" "POST"
|
||||
@param params 向接口传递的参数结构
|
||||
@param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
|
||||
@param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
|
||||
*/
|
||||
+ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken
|
||||
url:(NSString *)url
|
||||
httpMethod:(NSString *)httpMethod
|
||||
params:(NSDictionary *)params
|
||||
delegate:(id<WBHttpRequestDelegate>)delegate
|
||||
withTag:(NSString *)tag;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
取消网络请求接口
|
||||
调用此接口后,将取消当前网络请求,建议同时[WBHttpRequest setDelegate:nil];
|
||||
注意:该方法只对使用delegate的request方法有效。无法取消任何使用block的request的网络请求接口。
|
||||
*/
|
||||
- (void)disconnect;
|
||||
|
||||
#pragma mark - block extension
|
||||
|
||||
typedef void (^WBRequestHandler)(WBHttpRequest *httpRequest,
|
||||
id result,
|
||||
NSError *error);
|
||||
|
||||
/**
|
||||
统一微博Open API HTTP请求接口
|
||||
调用此接口后,将发送一个HTTP网络请求(用于访问微博open api)
|
||||
@param url 请求url地址
|
||||
@param httpMethod 支持"GET" "POST"
|
||||
@param params 向接口传递的参数结构
|
||||
@param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。
|
||||
@param handler 接口请求返回调用的block方法
|
||||
*/
|
||||
+ (WBHttpRequest *)requestWithURL:(NSString *)url
|
||||
httpMethod:(NSString *)httpMethod
|
||||
params:(NSDictionary *)params
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
|
||||
/**
|
||||
统一HTTP请求接口
|
||||
调用此接口后,将发送一个HTTP网络请求
|
||||
@param url 请求url地址
|
||||
@param httpMethod 支持"GET" "POST"
|
||||
@param params 向接口传递的参数结构
|
||||
@param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。
|
||||
@param handler 接口请求返回调用的block方法
|
||||
*/
|
||||
+ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken
|
||||
url:(NSString *)url
|
||||
httpMethod:(NSString *)httpMethod
|
||||
params:(NSDictionary *)params
|
||||
queue:(NSOperationQueue*)queue
|
||||
withCompletionHandler:(WBRequestHandler)handler;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// WBSDKBasicButton.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14/10/24.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class WBSDKBasicButton;
|
||||
typedef void (^WBSDKButtonHandler)(WBSDKBasicButton *button,
|
||||
BOOL isSuccess,
|
||||
NSDictionary *resultDict);
|
||||
|
||||
@interface WBSDKBasicButton : UIButton
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// WBSDKCommentButton.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14/10/26.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WBSDKBasicButton.h"
|
||||
|
||||
@interface WBSDKCommentButton : WBSDKBasicButton
|
||||
|
||||
/**
|
||||
初始化一个社会化评论按钮
|
||||
@param frame 按钮的frame值
|
||||
@param accessToken 用户授权后获取的Token
|
||||
@param keyWord 社会化评论的热点词
|
||||
@param urlString 社会化评论链接,可传空
|
||||
@param category 领域ID, 此参数为必选参数。
|
||||
@param handler 回调函数,当用户点击按钮,进行完与社会化评论组件相关的交互之后,回调的函数。
|
||||
*/
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
accessToken:(NSString*)accessToken
|
||||
keyword:(NSString*)keyWord
|
||||
urlString:(NSString*)urlString
|
||||
category:(NSString*)category
|
||||
completionHandler:(WBSDKButtonHandler)handler;
|
||||
|
||||
@property (nonatomic, strong)NSString* keyWord;
|
||||
@property (nonatomic, strong)NSString* accessToken;
|
||||
@property (nonatomic, strong)NSString* urlString;
|
||||
@property (nonatomic, strong)NSString* category;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// WBSDKRelationshipButton.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14/10/26.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WBSDKBasicButton.h"
|
||||
|
||||
enum
|
||||
{
|
||||
WBSDKRelationshipButtonStateFollow,
|
||||
WBSDKRelationshipButtonStateUnfollow
|
||||
};
|
||||
typedef NSUInteger WBSDKRelationshipButtonState;
|
||||
|
||||
|
||||
|
||||
@interface WBSDKRelationshipButton : WBSDKBasicButton
|
||||
|
||||
/**
|
||||
初始化一个关注组件按钮
|
||||
@param frame 按钮的frame值
|
||||
@param accessToken 用户授权后获取的Token
|
||||
@param currentUserID 当前用户的uid值
|
||||
@param followerUserID 希望当前用户加关注的用户uid值
|
||||
@param handler 回调函数,当用户点击按钮,进行完关注组件相关的交互之后,回调的函数。
|
||||
*/
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
accessToken:(NSString*)accessToken
|
||||
currentUser:(NSString*)currentUserID
|
||||
followUser:(NSString*)followerUserID
|
||||
completionHandler:(WBSDKButtonHandler)handler;
|
||||
|
||||
@property (nonatomic, strong)NSString* accessToken;
|
||||
@property (nonatomic, strong)NSString* currentUserID;
|
||||
@property (nonatomic, strong)NSString* followUserID;
|
||||
|
||||
|
||||
@property (nonatomic, assign)WBSDKRelationshipButtonState currentRelationShip;
|
||||
|
||||
|
||||
/**
|
||||
获取最新的关注状态
|
||||
该方法会调用OpenApi,获取当前用户与目标用户之间的关注状态,并将按钮的状态改变为正确的状态。
|
||||
*/
|
||||
- (void)checkCurrentRelationship;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// WeiboSDK+Statistics.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 15/4/13.
|
||||
// Copyright (c) 2015年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeiboSDK.h"
|
||||
|
||||
@interface WeiboSDK(Statistics)
|
||||
|
||||
/** 设置是否开启统计模式, 默认为NO.
|
||||
@param value 为YES, SDK会开启统计功能,记录日志,并在合适的实际传上服务器。
|
||||
@return void.
|
||||
*/
|
||||
+ (void)setStatisticsEnabled:(BOOL)value;
|
||||
|
||||
#pragma mark - Optional Configs Setting
|
||||
/** 设置是否打印SDK的log信息, 默认NO(不打印log).
|
||||
@param value 设置为YES, WeiboSDK 会输出log信息可供调试参考. 除非特殊需要,否则发布产品时需改回NO.
|
||||
@return void.
|
||||
*/
|
||||
+ (void)setStatisticsLogEnabled:(BOOL)value;
|
||||
|
||||
/** 设置版本信息.
|
||||
@param version 版本号,为nil或@""时, 默认为Build号(CFBundleVersion)
|
||||
@return void.
|
||||
*/
|
||||
+ (void)setVersion:(NSString*)version;
|
||||
|
||||
/** 设置渠道信息.
|
||||
@param channelID 渠道名称, 为nil或@""时, 默认为@"AppStore"渠道
|
||||
@return void.
|
||||
*/
|
||||
+ (void)setChannelID:(NSString*)channelID;
|
||||
|
||||
/** 设定日志上传的发送间隔
|
||||
@param frequecy 单位为秒,最小30秒,最大8*60*60秒(8小时)。默认为180秒(3分钟)
|
||||
@return void.
|
||||
*/
|
||||
+ (void)setUploadFrequecy:(NSTimeInterval)frequecy;
|
||||
|
||||
#pragma mark - Statistics Api
|
||||
/** 自动页面时长统计, 开始记录某个页面展示时长.
|
||||
使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
|
||||
在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
|
||||
@param pageName 统计的页面名称.
|
||||
@return void.
|
||||
*/
|
||||
+ (void)beginLogPageView:(NSString *)pageName;
|
||||
|
||||
/** 自动页面时长统计, 结束记录某个页面展示时长.
|
||||
使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
|
||||
在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
|
||||
@param pageName 统计的页面名称.
|
||||
@return void.
|
||||
*/
|
||||
+ (void)endLogPageView:(NSString *)pageName;
|
||||
|
||||
|
||||
/** 自动事件时长统计, 开始记录某个事示时长.
|
||||
使用方法:调用event:函数来完成自动统计。
|
||||
@param eventID 统计的事件标识符.
|
||||
@warning eventID不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符)
|
||||
*/
|
||||
+ (void)event:(NSString *)eventID;
|
||||
|
||||
/** 自动事件时长统计, 开始记录某个事示时长.
|
||||
使用方法:调用event:函数来完成自动统计。
|
||||
@param eventID 统计的事件标识符.
|
||||
@param pageName 事件发生时所在页面.
|
||||
@param userInfo 事件相关信息.
|
||||
@return void.
|
||||
|
||||
@warning 每个event的userInfo不能超过10个
|
||||
eventID、pageName、userInfo中key和value都不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符)
|
||||
*/
|
||||
+ (void)event:(NSString *)eventID onPageView:(NSString*)pageName withUserInfo:(NSDictionary*)userInfo;
|
||||
|
||||
/** 强制日志上传
|
||||
调用后,若距离上次成功上传日志时间不小于30秒,立刻上传日志。
|
||||
*/
|
||||
+ (void)forceUploadRecords;
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
After Width: | Height: | Size: 342 B |
|
After Width: | Height: | Size: 419 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 351 B |
|
After Width: | Height: | Size: 396 B |
|
After Width: | Height: | Size: 395 B |
|
After Width: | Height: | Size: 400 B |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 409 B |
|
After Width: | Height: | Size: 378 B |
|
After Width: | Height: | Size: 193 B |
|
After Width: | Height: | Size: 473 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 284 B |
|
After Width: | Height: | Size: 943 B |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 232 B |
|
After Width: | Height: | Size: 114 B |
|
After Width: | Height: | Size: 114 B |
|
After Width: | Height: | Size: 290 B |
|
After Width: | Height: | Size: 142 B |
|
After Width: | Height: | Size: 285 B |
|
After Width: | Height: | Size: 138 B |
|
After Width: | Height: | Size: 188 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 362 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 181 B |
|
After Width: | Height: | Size: 413 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 507 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +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,0 +1,786 @@
|
||||
//
|
||||
// WeiboSDKHeaders.h
|
||||
// WeiboSDKDemo
|
||||
//
|
||||
// Created by Wade Cheng on 4/3/13.
|
||||
// Copyright (c) 2013 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "WBHttpRequest.h"
|
||||
#import "WBHttpRequest+WeiboUser.h"
|
||||
#import "WBHttpRequest+WeiboShare.h"
|
||||
#import "WBHttpRequest+WeiboToken.h"
|
||||
#import "WBHttpRequest+WeiboGame.h"
|
||||
#import "WBSDKRelationshipButton.h"
|
||||
#import "WBSDKCommentButton.h"
|
||||
|
||||
|
||||
typedef NS_ENUM(NSInteger, WeiboSDKResponseStatusCode)
|
||||
{
|
||||
WeiboSDKResponseStatusCodeSuccess = 0,//成功
|
||||
WeiboSDKResponseStatusCodeUserCancel = -1,//用户取消发送
|
||||
WeiboSDKResponseStatusCodeSentFail = -2,//发送失败
|
||||
WeiboSDKResponseStatusCodeAuthDeny = -3,//授权失败
|
||||
WeiboSDKResponseStatusCodeUserCancelInstall = -4,//用户取消安装微博客户端
|
||||
WeiboSDKResponseStatusCodePayFail = -5,//支付失败
|
||||
WeiboSDKResponseStatusCodeShareInSDKFailed = -8,//分享失败 详情见response UserInfo
|
||||
WeiboSDKResponseStatusCodeUnsupport = -99,//不支持的请求
|
||||
WeiboSDKResponseStatusCodeUnknown = -100,
|
||||
};
|
||||
|
||||
@protocol WeiboSDKDelegate;
|
||||
@protocol WBHttpRequestDelegate;
|
||||
@class WBBaseRequest;
|
||||
@class WBBaseResponse;
|
||||
@class WBMessageObject;
|
||||
@class WBImageObject;
|
||||
@class WBBaseMediaObject;
|
||||
@class WBHttpRequest;
|
||||
@class WBOrderObject;
|
||||
/**
|
||||
微博SDK接口类
|
||||
*/
|
||||
@interface WeiboSDK : NSObject
|
||||
|
||||
/**
|
||||
检查用户是否安装了微博客户端程序
|
||||
@return 已安装返回YES,未安装返回NO
|
||||
*/
|
||||
+ (BOOL)isWeiboAppInstalled;
|
||||
|
||||
/**
|
||||
检查用户是否可以通过微博客户端进行分享
|
||||
@return 可以使用返回YES,不可以使用返回NO
|
||||
*/
|
||||
+ (BOOL)isCanShareInWeiboAPP;
|
||||
|
||||
/**
|
||||
检查用户是否可以使用微博客户端进行SSO授权
|
||||
@return 可以使用返回YES,不可以使用返回NO
|
||||
*/
|
||||
+ (BOOL)isCanSSOInWeiboApp;
|
||||
|
||||
/**
|
||||
打开微博客户端程序
|
||||
@return 成功打开返回YES,失败返回NO
|
||||
*/
|
||||
+ (BOOL)openWeiboApp;
|
||||
|
||||
/**
|
||||
获取微博客户端程序的itunes安装地址
|
||||
@return 微博客户端程序的itunes安装地址
|
||||
*/
|
||||
+ (NSString *)getWeiboAppInstallUrl;
|
||||
|
||||
/**
|
||||
获取当前微博客户端程序所支持的SDK最高版本
|
||||
@return 当前微博客户端程序所支持的SDK最高版本号,返回 nil 表示未安装微博客户端
|
||||
*/
|
||||
+ (NSString *)getWeiboAppSupportMaxSDKVersion __attribute__((deprecated));
|
||||
|
||||
/**
|
||||
获取当前微博SDK的版本号
|
||||
@return 当前微博SDK的版本号
|
||||
*/
|
||||
+ (NSString *)getSDKVersion;
|
||||
|
||||
|
||||
extern NSString * const WeiboSDKGetAidSucessNotification;
|
||||
extern NSString * const WeiboSDKGetAidFailNotification;
|
||||
/**
|
||||
获取当前微博SDK的aid
|
||||
返回的aid值可能为 nil ,当值为 nil 时会尝试获取 aid 值。
|
||||
当获取成功( aid 值变为有效值)时,SDK会发出名为 WeiboSDKGetAidSucessNotification 的通知,通知中带有 aid 值。
|
||||
当获取失败时,SDK会发出名为 WeiboSDKGetAidFailNotification 的通知,通知中带有 NSError 对象。
|
||||
@return aid 用于广告的与设备信息相关的标识符
|
||||
*/
|
||||
+ (NSString *)getWeiboAid;
|
||||
|
||||
/**
|
||||
向微博客户端程序注册第三方应用
|
||||
@param appKey 微博开放平台第三方应用appKey
|
||||
@return 注册成功返回YES,失败返回NO
|
||||
*/
|
||||
+ (BOOL)registerApp:(NSString *)appKey;
|
||||
|
||||
/**
|
||||
处理微博客户端程序通过URL启动第三方应用时传递的数据
|
||||
|
||||
需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用
|
||||
@param url 启动第三方应用的URL
|
||||
@param delegate WeiboSDKDelegate对象,用于接收微博触发的消息
|
||||
@see WeiboSDKDelegate
|
||||
*/
|
||||
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(id<WeiboSDKDelegate>)delegate;
|
||||
|
||||
/**
|
||||
发送请求给微博客户端程序,并切换到微博
|
||||
|
||||
请求发送给微博客户端程序之后,微博客户端程序会进行相关的处理,处理完成之后一定会调用 [WeiboSDKDelegate didReceiveWeiboResponse:] 方法将处理结果返回给第三方应用
|
||||
|
||||
@param request 具体的发送请求
|
||||
|
||||
@see [WeiboSDKDelegate didReceiveWeiboResponse:]
|
||||
@see WBBaseResponse
|
||||
*/
|
||||
+ (BOOL)sendRequest:(WBBaseRequest *)request;
|
||||
|
||||
/**
|
||||
收到微博客户端程序的请求后,发送对应的应答给微博客户端端程序,并切换到微博
|
||||
|
||||
第三方应用收到微博的请求后,异步处理该请求,完成后必须调用该函数将应答返回给微博
|
||||
|
||||
@param response 具体的应答内容
|
||||
@see WBBaseRequest
|
||||
*/
|
||||
+ (BOOL)sendResponse:(WBBaseResponse *)response;
|
||||
|
||||
/**
|
||||
设置WeiboSDK的调试模式
|
||||
|
||||
当开启调试模式时,WeiboSDK会在控制台输出详细的日志信息,开发者可以据此调试自己的程序。默认为 NO
|
||||
@param enabled 开启或关闭WeiboSDK的调试模式
|
||||
*/
|
||||
+ (void)enableDebugMode:(BOOL)enabled;
|
||||
|
||||
/**
|
||||
取消授权,登出接口
|
||||
调用此接口后,token将失效
|
||||
@param token 第三方应用之前申请的Token
|
||||
@param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
|
||||
@param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
|
||||
|
||||
*/
|
||||
+ (void)logOutWithToken:(NSString *)token delegate:(id<WBHttpRequestDelegate>)delegate withTag:(NSString*)tag;
|
||||
|
||||
/**
|
||||
邀请好友使用应用
|
||||
调用此接口后,将发送私信至好友,成功将返回微博标准私信结构
|
||||
@param data 邀请数据。必须为json字串的形式,必须做URLEncode,采用UTF-8编码。
|
||||
data参数支持的参数:
|
||||
参数名称 值的类型 是否必填 说明描述
|
||||
text string true 要回复的私信文本内容。文本大小必须小于300个汉字。
|
||||
url string false 邀请点击后跳转链接。默认为当前应用地址。
|
||||
invite_logo string false 邀请Card展示时的图标地址,大小必须为80px X 80px,仅支持PNG、JPG格式。默认为当前应用logo地址。
|
||||
@param uid 被邀请人,需为当前用户互粉好友。
|
||||
@param access_token 第三方应用之前申请的Token
|
||||
@param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
|
||||
@param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
|
||||
|
||||
*/
|
||||
+ (void)inviteFriend:(NSString* )data withUid:(NSString *)uid withToken:(NSString *)access_token delegate:(id<WBHttpRequestDelegate>)delegate withTag:(NSString*)tag;
|
||||
|
||||
/*
|
||||
第三方调用微博短信注册或者登陆
|
||||
@param navTitle 为登陆页navigationBar的title,如果为空的话,默认为“验证码登陆”
|
||||
*/
|
||||
+ (void)messageRegister:(NSString *)navTitle;
|
||||
@end
|
||||
|
||||
/**
|
||||
接收并处理来至微博客户端程序的事件消息
|
||||
*/
|
||||
@protocol WeiboSDKDelegate <NSObject>
|
||||
|
||||
/**
|
||||
收到一个来自微博客户端程序的请求
|
||||
|
||||
收到微博的请求后,第三方应用应该按照请求类型进行处理,处理完后必须通过 [WeiboSDK sendResponse:] 将结果回传给微博
|
||||
@param request 具体的请求对象
|
||||
*/
|
||||
- (void)didReceiveWeiboRequest:(WBBaseRequest *)request;
|
||||
|
||||
/**
|
||||
收到一个来自微博客户端程序的响应
|
||||
|
||||
收到微博的响应后,第三方应用可以通过响应类型、响应的数据和 WBBaseResponse.userInfo 中的数据完成自己的功能
|
||||
@param response 具体的响应对象
|
||||
*/
|
||||
- (void)didReceiveWeiboResponse:(WBBaseResponse *)response;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark - DataTransferObject and Base Request/Response
|
||||
|
||||
/**
|
||||
微博客户端程序和第三方应用之间传输数据信息的基类
|
||||
*/
|
||||
@interface WBDataTransferObject : NSObject
|
||||
|
||||
/**
|
||||
自定义信息字典,用于数据传输过程中存储相关的上下文环境数据
|
||||
|
||||
第三方应用给微博客户端程序发送 request 时,可以在 userInfo 中存储请求相关的信息。
|
||||
|
||||
@warning userInfo中的数据必须是实现了 `NSCoding` 协议的对象,必须保证能序列化和反序列化
|
||||
@warning 序列化后的数据不能大于10M
|
||||
*/
|
||||
@property (nonatomic, strong) NSDictionary *userInfo;
|
||||
|
||||
|
||||
/**
|
||||
发送该数据对象的SDK版本号
|
||||
|
||||
如果数据对象是自己生成的,则sdkVersion为当前SDK的版本号;如果是接收到的数据对象,则sdkVersion为数据发送方SDK版本号
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) NSString *sdkVersion;
|
||||
|
||||
|
||||
/**
|
||||
当用户没有安装微博客户端程序时是否提示用户打开微博安装页面
|
||||
|
||||
如果设置为YES,当用户未安装微博时会弹出Alert询问用户是否要打开微博App的安装页面。默认为YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL shouldOpenWeiboAppInstallPageIfNotInstalled;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
微博SDK所有请求类的基类
|
||||
*/
|
||||
@interface WBBaseRequest : WBDataTransferObject
|
||||
|
||||
/**
|
||||
返回一个 WBBaseRequest 对象
|
||||
|
||||
@return 返回一个*自动释放的*WBBaseRequest对象
|
||||
*/
|
||||
+ (id)request;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
微博SDK所有响应类的基类
|
||||
*/
|
||||
@interface WBBaseResponse : WBDataTransferObject
|
||||
|
||||
/**
|
||||
对应的 request 中的自定义信息字典
|
||||
|
||||
如果当前 response 是由微博客户端响应给第三方应用的,则 requestUserInfo 中会包含原 request.userInfo 中的所有数据
|
||||
|
||||
@see WBBaseRequest.userInfo
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) NSDictionary *requestUserInfo;
|
||||
|
||||
/**
|
||||
响应状态码
|
||||
|
||||
第三方应用可以通过statusCode判断请求的处理结果
|
||||
*/
|
||||
@property (nonatomic, assign) WeiboSDKResponseStatusCode statusCode;
|
||||
|
||||
/**
|
||||
返回一个 WBBaseResponse 对象
|
||||
|
||||
@return 返回一个*自动释放的*WBBaseResponse对象
|
||||
*/
|
||||
+ (id)response;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - Authorize Request/Response
|
||||
|
||||
/**
|
||||
第三方应用向微博客户端请求认证的消息结构
|
||||
|
||||
第三方应用向微博客户端申请认证时,需要调用 [WeiboSDK sendRequest:] 函数, 向微博客户端发送一个 WBAuthorizeRequest 的消息结构。
|
||||
微博客户端处理完后会向第三方应用发送一个结构为 WBAuthorizeResponse 的处理结果。
|
||||
*/
|
||||
@interface WBAuthorizeRequest : WBBaseRequest
|
||||
|
||||
/**
|
||||
微博开放平台第三方应用授权回调页地址,默认为`http://`
|
||||
|
||||
参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#.E5.AE.A2.E6.88.B7.E7.AB.AF.E9.BB.98.E8.AE.A4.E5.9B.9E.E8.B0.83.E9.A1.B5
|
||||
|
||||
@warning 必须保证和在微博开放平台应用管理界面配置的“授权回调页”地址一致,如未进行配置则默认为`http://`
|
||||
@warning 不能为空,长度小于1K
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *redirectURI;
|
||||
|
||||
/**
|
||||
微博开放平台第三方应用scope,多个scrope用逗号分隔
|
||||
|
||||
参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#scope
|
||||
|
||||
@warning 长度小于1K
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *scope;
|
||||
|
||||
/**
|
||||
当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候是否弹出SDK自带的Webview进行授权
|
||||
|
||||
如果设置为YES,当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候会自动弹出SDK自带的Webview进行授权。
|
||||
|
||||
如果设置为NO,会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框
|
||||
|
||||
默认为YES
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL shouldShowWebViewForAuthIfCannotSSO;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
微博客户端处理完第三方应用的认证申请后向第三方应用回送的处理结果
|
||||
|
||||
WBAuthorizeResponse 结构中仅包含常用的 userID 、accessToken 和 expirationDate 信息,其他的认证信息(比如部分应用可以获取的 refresh_token 信息)会统一存放到 userInfo 中
|
||||
*/
|
||||
@interface WBAuthorizeResponse : WBBaseResponse
|
||||
|
||||
/**
|
||||
用户ID
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *userID;
|
||||
|
||||
/**
|
||||
认证口令
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *accessToken;
|
||||
|
||||
/**
|
||||
认证过期时间
|
||||
*/
|
||||
@property (nonatomic, strong) NSDate *expirationDate;
|
||||
|
||||
/**
|
||||
当认证口令过期时用于换取认证口令的更新口令
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *refreshToken;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - ProvideMessageForWeibo Request/Response
|
||||
|
||||
/**
|
||||
微博客户端向第三方程序请求提供内容的消息结构
|
||||
*/
|
||||
@interface WBProvideMessageForWeiboRequest : WBBaseRequest
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
微博客户端向第三方应用请求提供内容,第三方应用向微博客户端返回的消息结构
|
||||
*/
|
||||
@interface WBProvideMessageForWeiboResponse : WBBaseResponse
|
||||
|
||||
/**
|
||||
提供给微博客户端的消息
|
||||
*/
|
||||
@property (nonatomic, strong) WBMessageObject *message;
|
||||
|
||||
/**
|
||||
返回一个 WBProvideMessageForWeiboResponse 对象
|
||||
@param message 需要回送给微博客户端程序的消息对象
|
||||
@return 返回一个*自动释放的*WBProvideMessageForWeiboResponse对象
|
||||
*/
|
||||
+ (id)responseWithMessage:(WBMessageObject *)message;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - SendMessageToWeibo Request/Response
|
||||
|
||||
/**
|
||||
第三方应用发送消息至微博客户端程序的消息结构体
|
||||
*/
|
||||
@interface WBSendMessageToWeiboRequest : WBBaseRequest
|
||||
|
||||
/**
|
||||
发送给微博客户端的消息
|
||||
*/
|
||||
@property (nonatomic, strong) WBMessageObject *message;
|
||||
|
||||
/**
|
||||
返回一个 WBSendMessageToWeiboRequest 对象
|
||||
此方法生成对象被[WeiboSDK sendRequest:]会唤起微博客户端的发布器进行分享,如果未安装微博客户端或客户端版本太低
|
||||
会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框
|
||||
@param message 需要发送给微博客户端的消息对象
|
||||
@return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象
|
||||
*/
|
||||
+ (id)requestWithMessage:(WBMessageObject *)message;
|
||||
|
||||
/**
|
||||
返回一个 WBSendMessageToWeiboRequest 对象
|
||||
|
||||
当用户安装了可以支持微博客户端內分享的微博客户端时,会自动唤起微博并分享
|
||||
当用户没有安装微博客户端或微博客户端过低无法支持通过客户端內分享的时候会自动唤起SDK內微博发布器
|
||||
|
||||
@param message 需要发送给微博的消息对象
|
||||
@param authRequest 授权相关信息,与access_token二者至少有一个不为空,当access_token为空并且需要弹出SDK內发布器时会通过此信息先进行授权后再分享
|
||||
@param access_token 第三方应用之前申请的Token,当此值不为空并且无法通过客户端分享的时候,会使用此token进行分享。
|
||||
@return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象
|
||||
*/
|
||||
+ (id)requestWithMessage:(WBMessageObject *)message
|
||||
authInfo:(WBAuthorizeRequest *)authRequest
|
||||
access_token:(NSString *)access_token;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
WBSendMessageToWeiboResponse
|
||||
*/
|
||||
@interface WBSendMessageToWeiboResponse : WBBaseResponse
|
||||
|
||||
/**
|
||||
可能在分享过程中用户进行了授权操作,当此值不为空时,为用户相应授权信息
|
||||
*/
|
||||
@property (nonatomic,strong) WBAuthorizeResponse *authResponse;
|
||||
@end
|
||||
|
||||
#pragma mark - ShareMessageToContact Request/Response
|
||||
/**
|
||||
第三方应用分享链接到私信
|
||||
*/
|
||||
@interface WBShareMessageToContactRequest : WBBaseRequest
|
||||
|
||||
/**
|
||||
分享链接的消息
|
||||
*/
|
||||
@property (nonatomic, strong) WBMessageObject *message;
|
||||
|
||||
/**
|
||||
返回一个 WBShareMessageToContactRequest 对象
|
||||
此方法生成对象被[WeiboSDK sendRequest:]会唤起微博客户端的发布器进行分享
|
||||
@param message 需要发送给微博客户端的消息对象
|
||||
@return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象
|
||||
*/
|
||||
+ (id)requestWithMessage:(WBMessageObject *)message;
|
||||
@end
|
||||
|
||||
/**
|
||||
WBSendMessageToWeiboResponse
|
||||
*/
|
||||
@interface WBShareMessageToContactResponse : WBBaseResponse
|
||||
|
||||
/**
|
||||
可能在分享过程中用户进行了授权操作,当此值不为空时,为用户相应授权信息
|
||||
*/
|
||||
@property (nonatomic,strong) WBAuthorizeResponse *authResponse;
|
||||
@end
|
||||
|
||||
#pragma mark - AppRecomend Request/Response
|
||||
|
||||
/**
|
||||
第三方应用私信好友推荐app的请求
|
||||
*/
|
||||
@interface WBSDKAppRecommendRequest : WBBaseRequest
|
||||
/**
|
||||
返回一个 WBSDKAppRecommendRequest 对象
|
||||
|
||||
@param uids 为推荐的好友列表,为空时跳转到用户自选的页面
|
||||
@param access_token 第三方应用之前申请的Token,当此值不为空并且无法通过客户端分享的时候,会使用此token私信。
|
||||
@return 返回一个*自动释放的*WBSDKAppRecommendRequest对象
|
||||
*/
|
||||
+ (id)requestWithUIDs:(NSArray *)uids access_token:(NSString *)access_token;
|
||||
|
||||
/**
|
||||
私信对象列表
|
||||
*/
|
||||
@property (nonatomic, strong) NSArray* uids;
|
||||
/**
|
||||
用于认证的Token
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *access_token;
|
||||
@end
|
||||
|
||||
/**
|
||||
第三方应用私信好友推荐app的响应
|
||||
|
||||
WBSDKAppRecommendResponse 结构中仅包含常用的 userID 、accessToken 和 expirationDate 信息,其他的认证信息(比如部分应用可以获取的 refresh_token 信息)会统一存放到 userInfo 中
|
||||
*/
|
||||
@interface WBSDKAppRecommendResponse : WBBaseResponse
|
||||
@property (nonatomic,strong) WBAuthorizeResponse *authResponse;
|
||||
/**
|
||||
用户ID
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *userID;
|
||||
|
||||
/**
|
||||
认证口令
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *accessToken;
|
||||
|
||||
/**
|
||||
认证过期时间
|
||||
*/
|
||||
@property (nonatomic, strong) NSDate *expirationDate;
|
||||
|
||||
/**
|
||||
当认证口令过期时用于换取认证口令的更新口令
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *refreshToken;
|
||||
@end
|
||||
|
||||
#pragma mark - Payment Request/Response
|
||||
|
||||
/**
|
||||
第三方应用发送消息至微博客户端程序的消息结构体
|
||||
*/
|
||||
@interface WBPaymentRequest : WBBaseRequest
|
||||
|
||||
/**
|
||||
发送给微博客户端的订单
|
||||
*/
|
||||
@property (nonatomic, strong) WBOrderObject *order;
|
||||
|
||||
/**
|
||||
返回一个 WBPaymentRequest 对象
|
||||
@param message 需要发送给微博客户端程序的消息对象
|
||||
@return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象
|
||||
*/
|
||||
+ (id)requestWithOrder:(WBOrderObject *)order;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
WBPaymentResponse
|
||||
*/
|
||||
@interface WBPaymentResponse : WBBaseResponse
|
||||
|
||||
/**
|
||||
支付返回状态码
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *payStatusCode;
|
||||
|
||||
/**
|
||||
支付返回状态信息
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *payStatusMessage;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - MessageObject / ImageObject
|
||||
|
||||
/**
|
||||
微博客户端程序和第三方应用之间传递的消息结构
|
||||
|
||||
一个消息结构由三部分组成:文字、图片和多媒体数据。三部分内容中至少有一项不为空,图片和多媒体数据不能共存。
|
||||
*/
|
||||
@interface WBMessageObject : NSObject
|
||||
|
||||
/**
|
||||
消息的文本内容
|
||||
|
||||
@warning 长度小于140个汉字
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *text;
|
||||
|
||||
/**
|
||||
消息的图片内容
|
||||
|
||||
@see WBImageObject
|
||||
*/
|
||||
@property (nonatomic, strong) WBImageObject *imageObject;
|
||||
|
||||
/**
|
||||
消息的多媒体内容
|
||||
|
||||
@see WBBaseMediaObject
|
||||
*/
|
||||
@property (nonatomic, strong) WBBaseMediaObject *mediaObject;
|
||||
|
||||
/**
|
||||
返回一个 WBMessageObject 对象
|
||||
|
||||
@return 返回一个*自动释放的*WBMessageObject对象
|
||||
*/
|
||||
+ (id)message;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
消息中包含的图片数据对象
|
||||
*/
|
||||
@interface WBImageObject : NSObject
|
||||
|
||||
/**
|
||||
图片真实数据内容
|
||||
|
||||
@warning 大小不能超过10M
|
||||
*/
|
||||
@property (nonatomic, strong) NSData *imageData;
|
||||
|
||||
/**
|
||||
返回一个 WBImageObject 对象
|
||||
|
||||
@return 返回一个*自动释放的*WBImageObject对象
|
||||
*/
|
||||
+ (id)object;
|
||||
|
||||
/**
|
||||
返回一个 UIImage 对象
|
||||
|
||||
@return 返回一个*自动释放的*UIImage对象
|
||||
*/
|
||||
- (UIImage *)image;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - Message Media Objects
|
||||
|
||||
/**
|
||||
消息中包含的多媒体数据对象基类
|
||||
*/
|
||||
@interface WBBaseMediaObject : NSObject
|
||||
|
||||
/**
|
||||
对象唯一ID,用于唯一标识一个多媒体内容
|
||||
|
||||
当第三方应用分享多媒体内容到微博时,应该将此参数设置为被分享的内容在自己的系统中的唯一标识
|
||||
@warning 不能为空,长度小于255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *objectID;
|
||||
|
||||
/**
|
||||
多媒体内容标题
|
||||
@warning 不能为空且长度小于1k
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *title;
|
||||
|
||||
/**
|
||||
多媒体内容描述
|
||||
@warning 长度小于1k
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *description;
|
||||
|
||||
/**
|
||||
多媒体内容缩略图
|
||||
@warning 大小小于32k
|
||||
*/
|
||||
@property (nonatomic, strong) NSData *thumbnailData;
|
||||
|
||||
/**
|
||||
点击多媒体内容之后呼起第三方应用特定页面的scheme
|
||||
@warning 长度小于255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *scheme;
|
||||
|
||||
/**
|
||||
返回一个 WBBaseMediaObject 对象
|
||||
|
||||
@return 返回一个*自动释放的*WBBaseMediaObject对象
|
||||
*/
|
||||
+ (id)object;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - Message Video Objects
|
||||
|
||||
/**
|
||||
消息中包含的视频数据对象
|
||||
*/
|
||||
@interface WBVideoObject : WBBaseMediaObject
|
||||
|
||||
/**
|
||||
视频网页的url
|
||||
|
||||
@warning 不能为空且长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *videoUrl;
|
||||
|
||||
/**
|
||||
视频lowband网页的url
|
||||
|
||||
@warning 长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *videoLowBandUrl;
|
||||
|
||||
/**
|
||||
视频数据流url
|
||||
|
||||
@warning 长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *videoStreamUrl;
|
||||
|
||||
/**
|
||||
视频lowband数据流url
|
||||
|
||||
@warning 长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *videoLowBandStreamUrl;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - Message Music Objects
|
||||
|
||||
/**
|
||||
消息中包含的音乐数据对象
|
||||
*/
|
||||
@interface WBMusicObject : WBBaseMediaObject
|
||||
|
||||
/**
|
||||
音乐网页url地址
|
||||
|
||||
@warning 不能为空且长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *musicUrl;
|
||||
|
||||
/**
|
||||
音乐lowband网页url地址
|
||||
|
||||
@warning 长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *musicLowBandUrl;
|
||||
|
||||
/**
|
||||
音乐数据流url
|
||||
|
||||
@warning 长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *musicStreamUrl;
|
||||
|
||||
|
||||
/**
|
||||
音乐lowband数据流url
|
||||
|
||||
@warning 长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *musicLowBandStreamUrl;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - Message WebPage Objects
|
||||
|
||||
/**
|
||||
消息中包含的网页数据对象
|
||||
*/
|
||||
@interface WBWebpageObject : WBBaseMediaObject
|
||||
|
||||
/**
|
||||
网页的url地址
|
||||
|
||||
@warning 不能为空且长度不能超过255
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *webpageUrl;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - OrderObject
|
||||
|
||||
/**
|
||||
微博客户端程序和第三方应用之间传递的订单结构
|
||||
*/
|
||||
@interface WBOrderObject : NSObject
|
||||
|
||||
/**
|
||||
订单编号
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *orderString;
|
||||
|
||||
|
||||
/**
|
||||
返回一个 WBOrderObject 对象
|
||||
|
||||
@return 返回一个*自动释放的*WBOrderObject对象
|
||||
*/
|
||||
+ (id)order;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// WeiboUser.h
|
||||
// WeiboSDK
|
||||
//
|
||||
// Created by DannionQiu on 14-9-23.
|
||||
// Copyright (c) 2014年 SINA iOS Team. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/*@
|
||||
You can get the latest WeiboUser field description on http://open.weibo.com/wiki/2/friendships/friends/en .
|
||||
*/
|
||||
@interface WeiboUser : NSObject
|
||||
|
||||
- (instancetype)initWithDictionary:(NSDictionary*)paraDict;
|
||||
+ (instancetype)userWithDictionary:(NSDictionary*)paraDict;
|
||||
|
||||
// Validate the dictionary to be converted.
|
||||
+ (BOOL)isValidForDictionary:(NSDictionary *)dict;
|
||||
|
||||
- (BOOL)updateWithDictionary:(NSDictionary*)paraDict;
|
||||
|
||||
|
||||
@property(readwrite, strong, nonatomic) NSString* userID;
|
||||
@property(readwrite, strong, nonatomic) NSString* userClass;
|
||||
@property(readwrite, strong, nonatomic) NSString* screenName;
|
||||
@property(readwrite, strong, nonatomic) NSString* name;
|
||||
@property(readwrite, strong, nonatomic) NSString* province;
|
||||
@property(readwrite, strong, nonatomic) NSString* city;
|
||||
@property(readwrite, strong, nonatomic) NSString* location;
|
||||
@property(readwrite, strong, nonatomic) NSString* userDescription;
|
||||
@property(readwrite, strong, nonatomic) NSString* url;
|
||||
@property(readwrite, strong, nonatomic) NSString* profileImageUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* coverImageUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* coverImageForPhoneUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* profileUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* userDomain;
|
||||
@property(readwrite, strong, nonatomic) NSString* weihao;
|
||||
@property(readwrite, strong, nonatomic) NSString* gender;
|
||||
@property(readwrite, strong, nonatomic) NSString* followersCount;
|
||||
@property(readwrite, strong, nonatomic) NSString* friendsCount;
|
||||
@property(readwrite, strong, nonatomic) NSString* pageFriendsCount;
|
||||
@property(readwrite, strong, nonatomic) NSString* statusesCount;
|
||||
@property(readwrite, strong, nonatomic) NSString* favouritesCount;
|
||||
@property(readwrite, strong, nonatomic) NSString* createdTime;
|
||||
@property(readwrite, assign, nonatomic) BOOL isFollowingMe;
|
||||
@property(readwrite, assign, nonatomic) BOOL isFollowingByMe;
|
||||
@property(readwrite, assign, nonatomic) BOOL isAllowAllActMsg;
|
||||
@property(readwrite, assign, nonatomic) BOOL isAllowAllComment;
|
||||
@property(readwrite, assign, nonatomic) BOOL isGeoEnabled;
|
||||
@property(readwrite, assign, nonatomic) BOOL isVerified;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedType;
|
||||
@property(readwrite, strong, nonatomic) NSString* remark;
|
||||
@property(readwrite, strong, nonatomic) NSString* statusID;
|
||||
@property(readwrite, strong, nonatomic) NSString* ptype;
|
||||
@property(readwrite, strong, nonatomic) NSString* avatarLargeUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* avatarHDUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedReason;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedTrade;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedReasonUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedSource;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedSourceUrl;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedState;
|
||||
@property(readwrite, strong, nonatomic) NSString* verifiedLevel;
|
||||
@property(readwrite, strong, nonatomic) NSString* onlineStatus;
|
||||
@property(readwrite, strong, nonatomic) NSString* biFollowersCount;
|
||||
@property(readwrite, strong, nonatomic) NSString* language;
|
||||
@property(readwrite, strong, nonatomic) NSString* star;
|
||||
@property(readwrite, strong, nonatomic) NSString* mbtype;
|
||||
@property(readwrite, strong, nonatomic) NSString* mbrank;
|
||||
@property(readwrite, strong, nonatomic) NSString* block_word;
|
||||
@property(readwrite, strong, nonatomic) NSString* block_app;
|
||||
@property(readwrite, strong, nonatomic) NSString* credit_score;
|
||||
@property(readwrite, strong, nonatomic) NSDictionary* originParaDict;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// UMSocialSinaHandler.h
|
||||
// UMSocialSDK
|
||||
//
|
||||
// Created by wyq.Cloudayc on 2/21/17.
|
||||
// Copyright © 2017 UMeng. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <UMSocialCore/UMSocialCore.h>
|
||||
|
||||
@interface UMSocialSinaHandler : UMSocialHandler
|
||||
|
||||
+ (UMSocialSinaHandler *)defaultManager;
|
||||
|
||||
|
||||
@end
|
||||