commit | author | age
|
d1f6ab
|
1 |
// |
H |
2 |
// WAUserProxy.h |
|
3 |
// WASdkIntfUI |
|
4 |
// |
|
5 |
// Created by GHW-T-01 on 16/3/1. |
|
6 |
// Copyright © 2016年 GHW-T-01. All rights reserved. |
|
7 |
// |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
#import <UIKit/UIKit.h> |
077804
|
11 |
#import <WASdkIntf/WALoginResult.h> |
L |
12 |
#import <WASdkIntf/WABindingResult.h> |
|
13 |
#import <WASdkIntf/WAAccount.h> |
|
14 |
#import <WASdkIntf/WAUserCenterResult.h> |
|
15 |
#import <WASdkIntf/WAAppUser.h> |
|
16 |
#import <WASdkIntf/WACertificationInfo.h> |
|
17 |
#import <WASdkIntf/WADeleteRequestModel.h> |
|
18 |
#import <WASdkIntf/WADeleteResult.h> |
|
19 |
|
d1f6ab
|
20 |
/*! |
H |
21 |
@discussion 登录协议 |
|
22 |
- - - |
|
23 |
*/ |
|
24 |
@protocol WALoginDelegate <NSObject> |
|
25 |
|
|
26 |
@required |
|
27 |
/*! |
|
28 |
@abstract 登录成功 |
2e0222
|
29 |
@param result 登录结果 |
d1f6ab
|
30 |
*/ |
H |
31 |
-(void)loginDidCompleteWithResults:(WALoginResult*)result; |
|
32 |
/*! |
|
33 |
@abstract 登录失败 |
|
34 |
@param result 登录的用户信息 注:这不是登录结果,由于登录失败所以userId是空的.但如果第三方平台(Facebook,Apple)授权成功,pUserId,pToken,extends不为空,可用于提示用户. |
|
35 |
@param error 错误 |
|
36 |
*/ |
|
37 |
-(void)loginDidFailWithError:(NSError*)error andResult:(WALoginResult*)result; |
|
38 |
@optional |
|
39 |
/*! |
|
40 |
@abstract 用户取消登录 |
|
41 |
@param result 登录的账户信息 (注:返回的result只有platform有值) |
|
42 |
*/ |
|
43 |
-(void)loginDidCancel:(WALoginResult*)result; |
|
44 |
|
|
45 |
@end |
|
46 |
|
|
47 |
/*! |
|
48 |
@discussion 账户绑定协议 |
|
49 |
- - - |
|
50 |
*/ |
|
51 |
@protocol WAAccountBindingDelegate <NSObject> |
|
52 |
|
|
53 |
@required |
|
54 |
/*! |
|
55 |
@abstract 绑定成功 |
|
56 |
@param result 绑定的账户信息 |
|
57 |
*/ |
|
58 |
-(void)bindingDidCompleteWithResult:(WABindingResult*)result; |
|
59 |
/*! |
|
60 |
@abstract 绑定失败 |
|
61 |
@param result 绑定的账户信息 |
|
62 |
@param error 错误 |
|
63 |
*/ |
|
64 |
-(void)bindingDidFailWithError:(NSError*)error andResult:(WABindingResult*)result; |
|
65 |
@optional |
|
66 |
/*! |
|
67 |
@abstract 绑定取消 |
|
68 |
@param result 绑定的账户信息(注:返回的result只有platform有值) |
|
69 |
*/ |
|
70 |
-(void)bindingDidCancel:(WABindingResult*)result; |
|
71 |
@end |
|
72 |
|
|
73 |
/*! |
|
74 |
@discussion 登录界面协议 |
|
75 |
- - - |
|
76 |
*/ |
|
77 |
@protocol WALoginViewDelegate <NSObject> |
|
78 |
|
|
79 |
@required |
|
80 |
/*! |
|
81 |
@abstract 登录成功 |
|
82 |
@param result 登录的用户信息 |
|
83 |
*/ |
|
84 |
-(void)loginViewDidCompleteWithResult:(WALoginResult*)result; |
|
85 |
/*! |
|
86 |
@abstract 登录失败 |
|
87 |
@param result 登录的用户信息 注:这不是登录结果,由于登录失败所以userId是空的.但如果第三方平台(Facebook,Apple)授权成功,pUserId,pToken,extends不为空,可用于提示用户. |
|
88 |
@param error 错误 |
|
89 |
*/ |
|
90 |
-(void)loginViewDidFailWithError:(NSError*)error andResult:(WALoginResult*)result; |
|
91 |
@optional |
|
92 |
/*! |
|
93 |
@abstract 用户取消登录 |
|
94 |
@param result 登录的用户信息(只有platform非空). |
|
95 |
*/ |
|
96 |
-(void)loginViewDidCancel:(WALoginResult*)result; |
|
97 |
@end |
|
98 |
|
b11815
|
99 |
|
L |
100 |
|
|
101 |
|
d1f6ab
|
102 |
/*! |
H |
103 |
@discussion 账号管理界面协议 |
|
104 |
- - - |
|
105 |
*/ |
|
106 |
@protocol WAAcctManagerDelegate <NSObject> |
|
107 |
|
|
108 |
@required |
|
109 |
/*! |
|
110 |
@abstract 新建账户回调接口 |
|
111 |
@param result 新建账户的账户信息 |
|
112 |
*/ |
|
113 |
-(void)newAcctDidCompleteWithResult:(WALoginResult*)result; |
|
114 |
/*! |
|
115 |
@abstract 切换账户回调接口 |
|
116 |
@param result 切换账户的账户信息 |
|
117 |
*/ |
|
118 |
-(void)switchAcctDidCompleteWithResult:(WALoginResult*)result; |
b11815
|
119 |
|
L |
120 |
/*! |
|
121 |
@abstract 绑定账号回调接口 |
|
122 |
@param bindResult 绑定账号信息 |
|
123 |
*/ |
|
124 |
-(void)bindAccountDidCompleteWithResult:(WABindingResult*)bindResult; |
d560f4
|
125 |
|
L |
126 |
|
|
127 |
/*! |
|
128 |
@abstract 实名认证成功回调接口 |
|
129 |
@param certificationInfo 实名认证信息 |
|
130 |
*/ |
|
131 |
-(void)realNameAuthtDidCompleteWithResult:(WACertificationInfo*)certificationInfo; |
|
132 |
|
d1f6ab
|
133 |
@end |
H |
134 |
|
56b891
|
135 |
/*! |
L |
136 |
@discussion 用户中心 |
|
137 |
- - - |
|
138 |
*/ |
|
139 |
@protocol WAUserCenterNoticeDelegate <NSObject> |
|
140 |
/*! |
|
141 |
@abstract 获取用户中心数据回调接口 |
|
142 |
@param result 用户中心数据信息 |
|
143 |
*/ |
|
144 |
- (void)userCenterNoticeWithResult:(WAUserCenterResult *)result; |
|
145 |
|
|
146 |
@end |
|
147 |
|
|
148 |
/*! |
|
149 |
@discussion 用户中心 |
|
150 |
- - - |
|
151 |
*/ |
|
152 |
@protocol WAUserCenterNoticeUIDelegate <NSObject> |
|
153 |
/*! |
|
154 |
@abstract 用户中心界面关闭回调接口 |
|
155 |
*/ |
|
156 |
- (void)userCenterNoticeClose; |
|
157 |
/*! |
|
158 |
@abstract 用户中心界面错误回调接口 |
|
159 |
@param error 用户中心错误信息 |
|
160 |
*/ |
|
161 |
- (void)userCenterNoticeError:(NSError *)error; |
|
162 |
|
|
163 |
@end |
|
164 |
|
d1f6ab
|
165 |
|
H |
166 |
/*! |
|
167 |
@discussion WAUserProxy 是用户模块的代理类。功能包括设置登录流程、登录、登出、绑定、解绑、查询当前用户绑定的第三方平台账户列表、切换账号、创建账号等等。 |
|
168 |
- - - |
|
169 |
*/ |
|
170 |
|
|
171 |
@interface WAUserProxy : NSObject |
|
172 |
|
|
173 |
/*! |
|
174 |
@discussion 设置登录流程 |
|
175 |
@param flowType 常量WA_LOGIN_FLOW_TYPE_DEFAULT是默认模式,表示切换新账户的时候不进行设备绑定操作,下次调用匿名登录还是登录之前的账户。常量WA_LOGIN_FLOW_TYPE_REBIND切换新账户的时候将当前设备的clientId绑定到新账户中,下一次匿名登录的时候将会登录到新账户。 |
|
176 |
*/ |
|
177 |
+(void)setLoginFlowType:(int)flowType; |
|
178 |
|
|
179 |
/*! |
|
180 |
@discussion 获取登录流程 |
|
181 |
*/ |
|
182 |
+(int)getLoginFlowType; |
|
183 |
|
|
184 |
/*! |
|
185 |
@discussion 登录接口 |
|
186 |
@param platform 登录平台:目前的登录平台有Facebook,Apple,GUEST,对应的常量分别是WA_PLATFORM_FACEBOOK,WA_PLATFORM_APPLE,WA_PLATFORM_WINGA。 |
|
187 |
@param extInfo 扩展信息 |
|
188 |
@param delegate 委托 |
|
189 |
*/ |
|
190 |
+(void)loginWithPlatform:(NSString *const)platform extInfo:(NSString*)extInfo delegate:(id<WALoginDelegate>)delegate; |
|
191 |
/*! |
|
192 |
@discussion 登出接口 |
|
193 |
*/ |
|
194 |
+(void)logout; |
|
195 |
|
|
196 |
/*! |
|
197 |
@discussion 绑定账户接口 |
|
198 |
@param platform 绑定平台:目前有Facebook,Apple,对应的常量分别为WA_PLATFORM_FACEBOOK,WA_PLATFORM_APPLE |
|
199 |
@param extInfo 扩展信息 |
|
200 |
@param delegate 委托 |
|
201 |
*/ |
|
202 |
+(void)bindingAccountWithPlatform:(NSString *const)platform extInfo:(NSString*)extInfo delegate:(id<WAAccountBindingDelegate>)delegate; |
|
203 |
/*! |
|
204 |
@discussion 查询绑定的第三方平台账户列表 |
|
205 |
@param block 回调 |
|
206 |
@error 错误 |
|
207 |
@accounts 数组accounts存放着WAAccount类型的对象. |
|
208 |
*/ |
|
209 |
+(void)queryBoundAccountWithCompleteBlock:(void(^)(NSError* error,NSArray<WAAccount *>* accounts))block; |
|
210 |
/*! |
|
211 |
@discussion 解绑账号接口 |
|
212 |
@param platform 解绑平台(WAAccount中的platform) |
|
213 |
@param pUserId 第三方平台用户id(WAAccount中的pUserId) |
|
214 |
*/ |
|
215 |
+(void)unBindAccountWithPlatform:(NSString *const)platform platformUserId:(NSString*)pUserId completeBlock:(void(^)(NSError* error))completeBlock; |
|
216 |
/*! |
|
217 |
@discussion 切换账号接口 |
|
218 |
@param platform 切换平台 |
2e0222
|
219 |
@param completeBlock 回调结果:包括error(错误)和result(登录结果) |
d1f6ab
|
220 |
*/ |
H |
221 |
+(void)switchAccountWithPlatform:(NSString *const)platform completeBlock:(void(^)(NSError* error,WALoginResult* result))completeBlock; |
|
222 |
|
|
223 |
/*! |
|
224 |
@discussion 创建账号接口 |
2e0222
|
225 |
@param completeBlock 回调结果:包括error(错误)和result(创建结果) |
d1f6ab
|
226 |
*/ |
H |
227 |
+(void)createNewAccountWithCompleteBlock:(void(^)(NSError* error,WALoginResult* result))completeBlock; |
|
228 |
|
|
229 |
|
|
230 |
/*! |
|
231 |
@abstract 调用此方法打开登录界面 |
|
232 |
@param delegate 委托 |
|
233 |
@param cacheEnabled 是否缓存登录方式 当该参数为YES,默认以上次登录方式登录,不会弹出登录选择框。 |
|
234 |
*/ |
|
235 |
+(void)login:(id<WALoginViewDelegate>)delegate cacheEnabled:(BOOL)cacheEnabled; |
|
236 |
/*! |
|
237 |
@abstract 调用此方法隐藏登录界面 |
|
238 |
*/ |
|
239 |
+(void)hide; |
|
240 |
/*! |
|
241 |
@abstract 清除登录方式的缓存 清除缓存之后会再次弹出登录选择框 |
|
242 |
*/ |
|
243 |
+(void)clearLoginCache; |
|
244 |
/*! |
|
245 |
@abstract 调用此方法打开账户管理界面 |
|
246 |
@param delegate 委托 |
|
247 |
*/ |
|
248 |
+(void)openAccountManager:(id<WAAcctManagerDelegate>)delegate; |
|
249 |
|
b11815
|
250 |
|
L |
251 |
/*! |
|
252 |
@abstract 调用此方法打开账户管理界面 |
|
253 |
@param delegate 委托 |
|
254 |
*/ |
|
255 |
+(void)openAccountCenter:(id<WAAcctManagerDelegate>)delegate; |
|
256 |
|
|
257 |
|
|
258 |
|
|
259 |
|
|
260 |
+(BOOL)isBoundPlatformAccount; |
d1f6ab
|
261 |
/*! |
H |
262 |
@abstract 获取账户信息 |
|
263 |
@param platform 平台 |
|
264 |
*/ |
|
265 |
+(WAAppUser*)getAccountInfoWithPlatform:(NSString *const)platform; |
|
266 |
|
|
267 |
//+(NSString*)transferWithPlatform:(NSString *const)platform; |
|
268 |
|
56b891
|
269 |
+ (void)getUserCenterNotice:(id<WAUserCenterNoticeDelegate>)delegate; |
L |
270 |
|
|
271 |
+ (void)showUserCenterNoticeUI:(id<WAUserCenterNoticeUIDelegate>)delegate; |
|
272 |
|
d1f6ab
|
273 |
/*! |
H |
274 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions]传递过来的参数。 |
|
275 |
*/ |
|
276 |
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; |
|
277 |
|
|
278 |
/*! |
2e0222
|
279 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidBecomeActive:(UIApplication *)application]传递过来的参数。 |
d1f6ab
|
280 |
*/ |
2e0222
|
281 |
+(void)applicationDidBecomeActive:(UIApplication *)application; |
H |
282 |
|
|
283 |
/*! |
|
284 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationWillEnterForeground:(UIApplication *)application]传递过来的参数。 |
|
285 |
*/ |
|
286 |
+(void)applicationWillEnterForeground:(UIApplication *)application; |
|
287 |
|
|
288 |
/*! |
|
289 |
@discussion 处理UIApplicationDelegate的方法[- (void)applicationDidEnterBackground:(UIApplication *)application]传递过来的参数。 |
|
290 |
*/ |
|
291 |
+(void)applicationDidEnterBackground:(UIApplication *)application; |
d1f6ab
|
292 |
|
H |
293 |
/*! |
|
294 |
@discussion 处理UIApplicationDelegate的方法[-(BOOL)application:(UIApplication *)application |
|
295 |
openURL:(NSURL *)url |
|
296 |
sourceApplication:(NSString *)sourceApplication |
|
297 |
annotation:(id)annotation]传递过来的参数。 |
|
298 |
*/ |
|
299 |
+(BOOL)application:(UIApplication *)application |
|
300 |
openURL:(NSURL *)url |
|
301 |
sourceApplication:(NSString *)sourceApplication |
|
302 |
annotation:(id)annotation; |
|
303 |
|
|
304 |
/*! |
|
305 |
@discussion (tip:CP无需关注)此方法为成功登录第三方平台之后调用。根据第三方平台的pUserId,pToken,platform构建一个WALoginResult实例作为参数调用此方法。此方法将会调用WindAnalytics的登录接口。 |
|
306 |
@param result 登录结果 |
|
307 |
@param delegate 委托 |
|
308 |
*/ |
|
309 |
+(void)loginWithResult:(WALoginResult*)result delegate:(id<WALoginDelegate>)delegate; |
|
310 |
|
|
311 |
+(void)loginWithResult:(WALoginResult*)result extInfo:(NSString*)extInfo delegate:(id<WALoginDelegate>)delegate; |
|
312 |
|
|
313 |
/*! |
|
314 |
@discussion (tip:CP无需关注)设置当前的登录平台 |
|
315 |
*/ |
|
316 |
+(void)setCurrentLoginPlatform:(NSString *const)platform; |
|
317 |
/*! |
|
318 |
@discussion (tip:CP无需关注)获取当前的登录平台 |
|
319 |
*/ |
|
320 |
+(NSString*)getCurrentLoginPlatform; |
|
321 |
/*! |
|
322 |
@discussion (tip:CP无需关注)获取当前的登录结果 |
|
323 |
*/ |
|
324 |
+(WALoginResult*)getCurrentLoginResult; |
|
325 |
|
|
326 |
/*! |
|
327 |
@discussion (tip:CP无需关注)获取用户模块组件 |
|
328 |
*/ |
|
329 |
+(NSArray*)getUserComponents; |
28ea02
|
330 |
|
L |
331 |
+(void)queryUserCertificationInfo:(void(^)(WACertificationInfo *certificationInfo,NSError *error))callBackBlock; |
|
332 |
|
d560f4
|
333 |
|
L |
334 |
/*! |
|
335 |
@discussion 检测是否可以打开账号绑定、账号切换、实名认证接口 |
|
336 |
*/ |
|
337 |
+ (BOOL)canOpenAccoutbind; |
|
338 |
+ (BOOL)canOpenAccoutSwitch; |
|
339 |
+ (BOOL)canOpenRealNameAuth; |
|
340 |
|
|
341 |
/*! |
|
342 |
@discussion 打开账户绑定界面 |
|
343 |
*/ |
|
344 |
+ (void)openAccoutbindManager:(void(^)(NSError* error,WABindingResult * bindResult))block; |
|
345 |
|
|
346 |
|
|
347 |
/*! |
|
348 |
@discussion 打开账户切换界面 |
|
349 |
*/ |
|
350 |
+ (void)openAccoutSwithchManager:(void(^)(NSError* error,WALoginResult * loginResult))block; |
|
351 |
|
|
352 |
|
|
353 |
/*! |
|
354 |
@discussion 打开实名认证界面 |
|
355 |
*/ |
|
356 |
+ (void)openRealNameAuthManager:(void(^)(NSError* error,WACertificationInfo * certificationInfo))block; |
|
357 |
|
|
358 |
|
69a363
|
359 |
|
L |
360 |
/*! |
|
361 |
@discussion 打开as评分弹框 |
|
362 |
*/ |
|
363 |
+ (void)openReview API_AVAILABLE(ios(10.3), macos(10.14)); |
|
364 |
|
|
365 |
|
|
366 |
|
3a96ff
|
367 |
/*! |
L |
368 |
@discussion 打开idfa弹框授权 |
|
369 |
*/ |
|
370 |
+ (void)openTTAAuthorizationWithCompletionHandler:(void(^)(NSError* error,NSUInteger status))block; |
|
371 |
|
|
372 |
/*! |
|
373 |
@discussion 隐私协议弹框 |
|
374 |
error 不为空时 |
|
375 |
status -1 弹出了协议框,用户点击了拒绝 |
|
376 |
|
|
377 |
error 为空 |
|
378 |
status 1 弹出了协议框,用户点击了同意 |
|
379 |
status 2 没有弹出协议框,用户之前点击过同意,无需再弹 |
|
380 |
*/ |
|
381 |
+ (void)openPrivacyAgreementWindow:(void(^)(NSError* error,NSUInteger status))bloc; |
|
382 |
|
077804
|
383 |
|
L |
384 |
|
|
385 |
|
|
386 |
|
|
387 |
|
|
388 |
|
|
389 |
|
|
390 |
|
|
391 |
|
|
392 |
|
|
393 |
//**************************************删除账号有关start************************************************************ |
|
394 |
|
|
395 |
/*! |
|
396 |
@discussion 检测是否可调用玩家身份确认接口 |
|
397 |
*/ |
|
398 |
+ (BOOL)canCheckIdentity; |
|
399 |
|
|
400 |
/*! |
|
401 |
@discussion 注销账号时,验证当前用户的身份证、id是否匹配,确认是本人操作 |
|
402 |
@param realName 姓名 |
|
403 |
@param idCard 身份证号码 |
|
404 |
*/ |
|
405 |
+ (void)identityCheck:(NSString*)realName idCard:(NSString*)idCard completeBlock:(void(^)(NSError* error))block; |
|
406 |
|
|
407 |
|
|
408 |
//删除账号授权,拿到第三方的token信息,如 signinwithapple拿到authorizationCode |
|
409 |
+ (void)deleteAccounAuthorizationWithPlatform:(NSString*)platform completeBlock:(void(^)(NSError* error,WADeleteRequestModel*deleteResult))block; |
|
410 |
|
|
411 |
|
|
412 |
/*! |
|
413 |
@discussion 账号删除接口 |
|
414 |
*/ |
|
415 |
+ (void)requestDeleteAccout:(WADeleteRequestModel*)deleteResult completeBlock:(void(^)(NSError* error,WADeleteResult*result))completeBlock; |
|
416 |
|
|
417 |
/*! |
|
418 |
@discussion 取消删除账号接口 |
|
419 |
*/ |
|
420 |
|
|
421 |
+ (void)cancelRequestDeleteAccoutWithUserid:(NSString*)userid callback:(void (^)(NSError *))completeBlock; |
|
422 |
|
|
423 |
|
|
424 |
// status==1,提交删除账号申请成功 |
|
425 |
// status==2,用户取消 |
|
426 |
+ (void)requestDeleteAccoutUI:(void(^)(NSError *error, NSUInteger status))completeBlock; |
|
427 |
|
|
428 |
|
|
429 |
|
|
430 |
|
|
431 |
//**************************************删除账号有关end************************************************************ |
|
432 |
|
|
433 |
|
|
434 |
|
|
435 |
|
|
436 |
|
|
437 |
|
d1f6ab
|
438 |
@end |