RASingleton.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. - (void)saveUserInfo;
  31. - (NSString *)savedUser;
  32. - (NSString *)savedPassword;
  33. - (void)loginUser:(NSString *)user password:(NSString *)password;
  34. - (BOOL)autoLogin;
  35. - (void)logout;
  36. - (void)loadSavedReuqiredLocation;
  37. - (NSString *)encryptString:(NSString *)str;
  38. - (NSString *)decryptString:(NSString *)str;
  39. - (void)writeLog:(NSString *)log;
  40. - (void)saveLogs;
  41. - (void)changePassword:(NSString *)password;
  42. @end