-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8db6df0
commit 84b4711
Showing
11 changed files
with
144 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// RadarLog.h | ||
// RadarSDK | ||
// | ||
// Copyright © 2021 Radar Labs, Inc. All rights reserved. | ||
// | ||
|
||
#import "Radar.h" | ||
|
||
/** | ||
Represents a debug log. | ||
*/ | ||
@interface RadarLog : NSObject <NSCoding> | ||
|
||
/** | ||
The levels for debug logs. | ||
*/ | ||
@property (assign, nonatomic, readonly) RadarLogLevel level; | ||
|
||
/** | ||
The log message. | ||
*/ | ||
@property (nonnull, copy, nonatomic, readonly) NSString *message; | ||
|
||
/** | ||
The log type. | ||
*/ | ||
@property (assign, nonatomic, readonly) RadarLogType type; | ||
|
||
/** | ||
The datetime when the log occurred on the device. | ||
*/ | ||
@property (nonnull, copy, nonatomic, readonly) NSDate *createdAt; | ||
|
||
- (instancetype _Nullable)initWithLevel:(RadarLogLevel)level type:(RadarLogType)type message:(NSString *_Nullable)message; | ||
|
||
- (NSDictionary *_Nonnull)dictionaryValue; | ||
|
||
+ (NSArray<NSDictionary *> *_Nullable)arrayForLogs:(NSArray<RadarLog *> *_Nullable)logs NS_SWIFT_NAME(arrayForLogs(_:)); | ||
|
||
/** | ||
Returns a display string for a log level. | ||
@param level A log level | ||
@return A display string for the log level. | ||
*/ | ||
+ (NSString *_Nonnull)stringForLogLevel:(RadarLogLevel)level NS_SWIFT_NAME(stringForLogLevel(_:)); | ||
|
||
/** | ||
Return the log level for a specific display string | ||
@param string A display string for the log level | ||
@return A log level. | ||
*/ | ||
+ (RadarLogLevel) levelFromString:(NSString *_Nonnull) string; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// RadarUtils.h | ||
// RadarSDK | ||
// | ||
// Copyright © 2019 Radar Labs, Inc. All rights reserved. | ||
// | ||
|
||
#import <CoreLocation/CLLocation.h> | ||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface RadarUtils : NSObject | ||
|
||
@property (class, nonatomic, assign, readonly) NSDateFormatter *isoDateFormatter; | ||
|
||
+ (NSString *)deviceModel; | ||
+ (NSString *)deviceOS; | ||
+ (NSString *)country; | ||
+ (NSNumber *)timeZoneOffset; | ||
+ (NSString *)sdkVersion; | ||
+ (NSString *)deviceId; | ||
+ (NSString *)deviceType; | ||
+ (NSString *)deviceMake; | ||
+ (BOOL)isSimulator; | ||
+ (BOOL)locationBackgroundMode; | ||
+ (NSString *)locationAuthorization; | ||
+ (NSString *)locationAccuracyAuthorization; | ||
+ (BOOL)foreground; | ||
+ (NSTimeInterval)backgroundTimeRemaining; | ||
+ (CLLocation *)locationForDictionary:(NSDictionary *_Nonnull)dict; | ||
+ (NSDictionary *)dictionaryForLocation:(CLLocation *)location; | ||
+ (NSString *)dictionaryToJson:(NSDictionary *)dict; | ||
+ (NSDictionary<NSString *, NSString *> *)extractGeofenceIdAndTimestampFromIdentifier:(NSString *)identifier; | ||
+ (void)runOnMainThread:(dispatch_block_t)block; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters