diff options
author | Alex Zolotarev <alex@maps.me> | 2015-08-06 21:54:16 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:00:15 +0300 |
commit | 914515733940c16d98412adba4981484fdd567b5 (patch) | |
tree | 53f278fe837de9ac58db5a610652cb716d16984d /3party/Alohalytics/src/alohalytics_objc.h | |
parent | 0cd24f656e69356e35354558e39ca9bcda4d7ce3 (diff) |
[alohalytics][ios] Measure total time spent in the app, get install/update/build/first launch date.
Diffstat (limited to '3party/Alohalytics/src/alohalytics_objc.h')
-rw-r--r-- | 3party/Alohalytics/src/alohalytics_objc.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/3party/Alohalytics/src/alohalytics_objc.h b/3party/Alohalytics/src/alohalytics_objc.h index 5396471b5b..922c79089c 100644 --- a/3party/Alohalytics/src/alohalytics_objc.h +++ b/3party/Alohalytics/src/alohalytics_objc.h @@ -23,11 +23,13 @@ *******************************************************************************/ // Convenience header to use from pure Objective-C project. +// TODO(AlexZ): Refactor it to use instance and it's methods instead of static functions. #ifndef ALOHALYTICS_OBJC_H #define ALOHALYTICS_OBJC_H #import <Foundation/Foundation.h> +#import <Foundation/NSDate.h> #import <CoreLocation/CoreLocation.h> @interface Alohalytics : NSObject @@ -35,9 +37,6 @@ // Should be called in application:didFinishLaunchingWithOptions: or in application:willFinishLaunchingWithOptions: // Final serverUrl is modified to $(serverUrl)/[ios|mac]/your.bundle.id/app.version + (void)setup:(NSString *)serverUrl withLaunchOptions:(NSDictionary *)options; -// Alternative to the previous setup method if you integrated Alohalytics after initial release -// and don't want to count app upgrades as new installs (and definitely know that it's an already existing user). -+ (void)setup:(NSString *)serverUrl andFirstLaunch:(BOOL)isFirstLaunch withLaunchOptions:(NSDictionary *)options; + (void)forceUpload; + (void)logEvent:(NSString *)event; + (void)logEvent:(NSString *)event atLocation:(CLLocation *)location; @@ -48,6 +47,21 @@ + (void)logEvent:(NSString *)event withKeyValueArray:(NSArray *)array atLocation:(CLLocation *)location; + (void)logEvent:(NSString *)event withDictionary:(NSDictionary *)dictionary; + (void)logEvent:(NSString *)event withDictionary:(NSDictionary *)dictionary atLocation:(CLLocation *)location; +// Returns YES if it is a first session, before app goes into background. ++ (BOOL)isFirstSession; +// Returns summary time of all active user sessions up to now. ++ (NSInteger)totalSecondsSpentInTheApp; + +// Returns the date when app was launched for the first time (usually the same as install date). ++ (NSDate *)firstLaunchDate; +// When app was installed (it's Documents folder creation date). +// Note: firstLaunchDate is usually later than installDate. ++ (NSDate *)installDate; +// When app was updated (~== installDate for the first installation, it's Resources folder creation date). ++ (NSDate *)updateDate; +// When the binary was built. +// Hint: if buildDate > installDate then this is not a new app install, but an existing old user. ++ (NSDate *)buildDate; @end #endif // #ifndef ALOHALYTICS_OBJC_H |