NSUserDefaults+MMEConfiguration.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #import <Foundation/Foundation.h>
  2. #import <CoreLocation/CoreLocation.h>
  3. NS_ASSUME_NONNULL_BEGIN
  4. // MARK: -
  5. @class MMEDate;
  6. @interface NSUserDefaults (MMEConfiguration)
  7. /// the shared NSUserDefaults object with the MMEConfigurationDomain loaded and our defaults registered
  8. + (instancetype)mme_configuration;
  9. // MARK: - Event Manager Configuration
  10. /// Interval to wait before starting up when the application launches
  11. @property (nonatomic, readonly) NSTimeInterval mme_startupDelay;
  12. /// Number of events to put into a batch, the MMEEventsManager will flush it's queue at this threshold
  13. @property (nonatomic, readonly) NSUInteger mme_eventFlushCount;
  14. /// Maximum Time interval between event flush
  15. @property (nonatomic, readonly) NSTimeInterval mme_eventFlushInterval;
  16. /// Interval at which we rotate the unique identifier for this SDK instance
  17. @property (nonatomic, readonly) NSTimeInterval mme_identifierRotationInterval;
  18. /// Interval at which we check for updated configuration
  19. @property (nonatomic, readonly) NSTimeInterval mme_configUpdateInterval;
  20. /// Tag for events
  21. @property (nonatomic, readonly) NSString *mme_eventTag;
  22. // MARK: - Volatile Configuration
  23. /// Access Token
  24. @property (nonatomic, copy, setter=mme_setAccessToken:) NSString *mme_accessToken;
  25. /// User-Agent Base
  26. @property (nonatomic, copy, setter=mme_setLegacyUserAgentBase:) NSString *mme_legacyUserAgentBase;
  27. /// Host SDK Version
  28. @property (nonatomic, copy, setter=mme_setLegacyHostSDKVersion:) NSString *mme_legacyHostSDKVersion;
  29. /// CN Region Setting
  30. @property (nonatomic, assign, setter=mme_setIsCNRegion:) BOOL mme_isCNRegion;
  31. // MARK: - Service Configuration
  32. /// API Service URL for the current region
  33. @property (nonatomic, readonly) NSURL *mme_APIServiceURL;
  34. /// Events Service URL for the current region
  35. @property (nonatomic, readonly) NSURL *mme_eventsServiceURL;
  36. /// Config Service URL for the current region
  37. @property (nonatomic, readonly) NSURL *mme_configServiceURL;
  38. /// Reformed User-Agent String
  39. @property (nonatomic, readonly) NSString *mme_userAgentString;
  40. /// Legacy User-Agent String
  41. @property (nonatomic, readonly) NSString *mme_legacyUserAgentString;
  42. // MARK: - Update Configuration
  43. @property (nonatomic, nullable, setter=mme_setConfigUpdateDate:) MMEDate *mme_configUpdateDate;
  44. // MARK: - Location Collection
  45. /// This property is only settable by the end user
  46. @property (nonatomic, setter=mme_setIsCollectionEnabled:) BOOL mme_isCollectionEnabled;
  47. /// This property is volatile
  48. @property (nonatomic, readonly) BOOL mme_isCollectionEnabledInSimulator;
  49. @property (nonatomic, readonly) BOOL mme_isCollectionEnabledInLowPowerMode;
  50. // MARK: - Background Collection
  51. /// Bool, is background collection enabled
  52. @property (nonatomic, readonly) BOOL mme_isCollectionEnabledInBackground;
  53. /// Interval to wait before starting telemetry collection in the background
  54. @property (nonatomic, readonly) NSTimeInterval mme_backgroundStartupDelay;
  55. /// Distance to set for the background collection geo-fence
  56. @property (nonatomic, readonly) CLLocationDistance mme_backgroundGeofence;
  57. /// Horizontal accuracy value set for filtering locations
  58. @property (nonatomic, readonly) CLLocationAccuracy mme_horizontalAccuracy;
  59. // MARK: - Certificate Pinning and Revocation
  60. /// An array of revoked public key hashes
  61. @property (nonatomic, readonly) NSArray<NSString *>*mme_certificateRevocationList;
  62. /// The Certificate Pinning config
  63. @property (nonatomic, readonly) NSDictionary *mme_certificatePinningConfig;
  64. @end
  65. NS_ASSUME_NONNULL_END