RASingleton.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // RASingleton.h
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/6.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. typedef enum {
  10. RABackgroundReportTypeNone = 0, ///<没有设置
  11. RABackgroundReportTypeReject = 1, ///< 拒绝
  12. RABackgroundReportTypeAlwaysAsk = 2, ///< 每次询问
  13. RABackgroundReportTypeAllow = 3 ///< 同意
  14. } RABackgroundReportType;
  15. @class CLLocation;
  16. @interface RASingleton : NSObject
  17. + (instancetype)sharedInstance;
  18. @property (nonatomic,copy,readonly) NSString *user;
  19. @property (nonatomic,copy,readonly) NSString *password;
  20. @property (nonatomic,strong) CLLocation *currentLocation;
  21. @property (nonatomic,strong) CLLocation *lastLocation;
  22. @property (nonatomic,strong) NSString *lastLocationDateTime;
  23. @property (nonatomic,copy,readonly) NSString *secretKey;
  24. @property (nonatomic,copy,readonly) NSString *encryptUser;
  25. @property (nonatomic,copy,readonly) NSString *encryptPassword;
  26. @property (nonatomic,copy) NSString *notificationToken;
  27. @property (nonatomic,assign) BOOL requiredLocation;
  28. @property (nonatomic,strong) NSOperationQueue *networkQueue;
  29. @property (nonatomic,assign) RABackgroundReportType backgroundReportType;///<后台位置报告权限类型
  30. @property (nonatomic,copy) NSString *firstName;
  31. @property (nonatomic,assign) BOOL savePassword;
  32. @property (nonatomic,assign) BOOL offline;
  33. - (void)saveUserInfo;
  34. - (NSString *)savedUser;
  35. - (NSString *)savedPassword;
  36. - (void)loginUser:(NSString *)user password:(NSString *)password firstName:(NSString *)firstName;
  37. - (BOOL)autoLogin;
  38. - (void)logout;
  39. - (void)loadSavedReuqiredLocation;
  40. - (NSString *)encryptString:(NSString *)str;
  41. - (NSString *)decryptString:(NSString *)str;
  42. - (void)writeLog:(NSString *)log;
  43. - (void)saveLogs;
  44. - (void)changePassword:(NSString *)password;
  45. @end