-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeiboWrapper.h
64 lines (51 loc) · 1.77 KB
/
WeiboWrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// WeiboWrapper.h
// Slate
//
// Created by lin yize on 16-6-3.
// Copyright (c) 2016年 modernmedia. All rights reserved.
//
#import <Foundation/Foundation.h>
/*
* 微博API封装,兼容oauth登录 和 iOS原生微博功能
*
*/
@interface WeiboWrapper : NSObject
@property (nonatomic, strong) NSError *lastError;
// 单例
+ (instancetype)sharedWrapper;
// 初始化设置参数
- (void)setWeiboAppKey:(NSString *)key weiboAppSecret:(NSString *)secret weiboRedirectUrl:(NSString *)redirectUrl;
// 进行微博登录
- (void)weiboLogin:(void(^)(BOOL isLogin))loginBlock;
// 微博是否登录
- (void)weiboIsLogin:(void(^)(BOOL isLogin))isLoginBlock;
// 微博登出
- (void)weiboLogout;
/*
* 微博关注
* @param followBlock
* @param screenName 要关注的微博昵称
*/
- (void)weiboFollow:(void(^)(BOOL success))followBlock screenName:(NSString *)screenName;
/*
* 发送微博
* @param content 微博内容
* @param image 图片
* @param url 网址
* @param shareBlock
* @param editable 是否打开编辑框,不打开的话就直接发送了
*/
- (void)weiboShareWithContent:(NSString *)content image:(UIImage *)image url:(NSURL *)url shareBlock:(void(^)(BOOL success))shareBlock editable:(BOOL)editable;
/*
* 获取微博账户信息
* @block param weiboUid 微博uid
* @block param weiboNickname 微博昵称
* @block param weiboAvatarUrl 微博头像网址
*/
- (void)weiboProfile:(void (^)(BOOL success, NSString *weiboUid, NSString *accessToken, NSString *weiboNickname, NSString *weiboAvatarUrl, NSString *userAddingInfo))profileBlock;
// sso相关方法
- (void)applicationDidBecomeActive;
- (BOOL)isWeiboSSOURL:(NSURL *)url;
- (BOOL)weiboSSOHandleOpenURL:(NSURL *)url;
@end