AppService.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // AppService.h
  3. // WildFireChat
  4. //
  5. // Created by Heavyrain Lee on 2019/10/22.
  6. // Copyright © 2019 WildFireChat. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <WFChatUIKit/WFChatUIKit.h>
  10. #import <WFChatClient/WFCChatClient.h>
  11. #import "Device.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. @interface AppService : NSObject <WFCUAppServiceProvider, WFCCDefaultPortraitProvider>
  14. + (AppService *)sharedAppService;
  15. - (void)loginWithMobile:(NSString *)mobile verifyCode:(NSString *)verifyCode success:(void(^)(NSString *userId, NSString *token, BOOL newUser, NSString *resetCode))successBlock error:(void(^)(int errCode, NSString *message))errorBlock;
  16. - (void)loginWithMobile:(NSString *)mobile password:(NSString *)password success:(void(^)(NSString *userId, NSString *token, BOOL newUser))successBlock error:(void(^)(int errCode, NSString *message))errorBlock;
  17. - (void)resetPassword:(NSString *)mobile code:(NSString *)code newPassword:(NSString *)newPassword success:(void(^)(void))successBlock error:(void(^)(int errCode, NSString *message))errorBlock;
  18. - (void)changePassword:(NSString *)oldPassword newPassword:(NSString *)newPassword success:(void(^)(void))successBlock error:(void(^)(int errCode, NSString *message))errorBlock;
  19. - (void)sendLoginCode:(NSString *)phoneNumber success:(void(^)(void))successBlock error:(void(^)(NSString *message))errorBlock;
  20. - (void)sendResetCode:(NSString *)phoneNumber success:(void(^)(void))successBlock error:(void(^)(NSString *message))errorBlock;
  21. //发送删除账号验证码
  22. - (void)sendDestroyAccountCode:(void(^)(void))successBlock error:(void(^)(int errorCode, NSString *message))errorBlock;
  23. - (void)destroyAccount:(NSString *)code success:(void(^)(void))successBlock error:(void(^)(int errorCode, NSString *message))errorBlock;
  24. - (void)pcScaned:(NSString *)sessionId success:(void(^)(void))successBlock error:(void(^)(int errorCode, NSString *message))errorBlock;
  25. - (void)pcConfirmLogin:(NSString *)sessionId success:(void(^)(void))successBlock error:(void(^)(int errorCode, NSString *message))errorBlock;
  26. - (void)pcCancelLogin:(NSString *)sessionId success:(void(^)(void))successBlock error:(void(^)(int errorCode, NSString *message))errorBlock;
  27. - (void)uploadLogs:(void(^)(void))successBlock error:(void(^)(NSString *errorMsg))errorBlock;
  28. - (void)showPCSessionViewController:(UIViewController *)baseController pcClient:(WFCCPCOnlineInfo *)clientInfo;
  29. - (void)addDevice:(NSString *)name
  30. deviceId:(NSString *)deviceId
  31. owner:(NSArray<NSString *> *)owners
  32. success:(void(^)(Device *device))successBlock
  33. error:(void(^)(int error_code))errorBlock;
  34. - (void)getMyDevices:(void(^)(NSArray<Device *> *devices))successBlock
  35. error:(void(^)(int error_code))errorBlock;
  36. - (void)delDevice:(NSString *)deviceId
  37. success:(void(^)(Device *device))successBlock
  38. error:(void(^)(int error_code))errorBlock;
  39. - (NSData *)getAppServiceCookies;
  40. - (NSString *)getAppServiceAuthToken;
  41. //清除应用服务认证cookies和认证token
  42. - (void)clearAppServiceAuthInfos;
  43. @end
  44. NS_ASSUME_NONNULL_END