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