Permalink
Browse files

added analytics provider libraries

  • Loading branch information...
1 parent 0bba624 commit 2609f85cc78be62a798dcb6ac81d5e593f2e87c9 @chrispix chrispix committed Feb 13, 2012
@@ -0,0 +1,66 @@
+//
+// Apsalar.h
+// Apsalar SDK for iPhone/iOS public API
+//
+// Copyright © 2010-2011 Apsalar Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+typedef enum { // APTIMIZER
+ AP_TRIGGER_SUCCESS, // An overlay was loaded
+ AP_TRIGGER_NOT_SHOWN, // Overlay not shown, unknown reason
+ AP_TRIGGER_NOT_READY, // Apsalar session not started
+ AP_TRIGGER_NO_CONNECTIVITY, // No connectivity needed to do overlay
+ AP_TRIGGER_NO_RULE, // No rules connected to this trigger
+ AP_TRIGGER_UNKNOWN, // New trigger, not yet registered
+ AP_TRIGGER_CURRENTLY_ACTIVE // A trigger is already active
+} AP_TRIGGER_RESULT;
+
+@interface Apsalar : NSObject
++ (void) startSession:(NSString *)apiKey withKey:(NSString *)apiSecret ;
++ (void) startSession:(NSString *)apiKey // APTIMIZER
+ withKey:(NSString *)apiSecret // APTIMIZER
+ andLaunchOptions:(NSDictionary *)launchOptions; // APTIMIZER
++ (void) reStartSession:(NSString *)apiKey withKey:(NSString *)apiSecret;
++ (BOOL) sessionStarted;
++ (void) endSession;
++ (void) event:(NSString *)name;
++ (void) event:(NSString *)name withArgs:(NSDictionary *)args;
++ (void) eventWithArgs:(NSString *)name, ...; // use only subclasses of
+ // NSObject, not primitive types
+ // like int
++ (void) catchExceptions;
++ (Apsalar *) shared;
++ (void) registerCallback:(NSString *)signature // APTIMIZER
+ obj:(NSObject *)obj // APTIMIZER
+ selector:(SEL)selector; // APTIMIZER
++ (NSInteger) trigger:(NSString *)name; // APTIMIZER
++ (void) callback:(NSString *)url; // APTIMIZER
++ (NSTimeInterval) sessionDuration;
++ (NSDate *) sessionStartDate;
++ (NSString *) sessionID;
++ (NSString *) version;
++ (void) setBufferLimit:(int)size;
+@property(nonatomic, readonly) NSString *applicationName;
+@property(nonatomic, readonly) NSString *applicationIdentifier;
+@property(nonatomic) int contentDisplayTimeout;
++ (void) setContentDisplayTimeout:(int)seconds;
+@property(nonatomic) BOOL triggerActive; // APTIMIZER
++ (BOOL) triggerActive; // APTIMIZER
+@end
+
+@interface ApButton: UIButton {
+ @private
+ int ap_flags;
+}
+@property(nonatomic, retain) UIButton *actual;
+@property(nonatomic, retain) NSString *name;
+@property(nonatomic, retain) NSString *title;
+@property(nonatomic, retain) NSString *btnType;
+@property(nonatomic) BOOL connected;
+@end
+
+@interface ApFeedbackButton: ApButton
+@end
Binary file not shown.
@@ -0,0 +1,90 @@
+//
+// FlurryAnalytics.h
+// Flurry iOS Analytics Agent
+//
+// Copyright 2009-2011 Flurry, Inc. All rights reserved.
+//
+// Methods in this header file are for use with Flurry Analytics
+
+#import <UIKit/UIKit.h>
+
+/*!
+ * \brief Provides all available methods for defining and reporting Analytics from use
+ * of your app.
+ *
+ * Set of methods that allow developers to capture detailed, aggregate information
+ * regarding the use of their app by end users.
+ * \author 2009 - 2011 Flurry, Inc. All Rights Reserved.
+ */
+
+/*!
+ * @class FlurryAnalytics
+ * @abstract Provides all available methods for defining and reporting Analytics from use
+ * of your app.
+ * @discussion Set of methods that allow developers to capture detailed, aggregate information
+ * regarding the use of their app by end users.
+ * @helps This class provides methods necessary for correct function of FlurryAppCircle.h.
+ * For information on how to use Flurry's AppCircle SDK to
+ * attract high-quality users and monetize your user base see http://wiki.flurry.com/index.php?title=AppCircle.
+ *
+ */
+
+@interface FlurryAnalytics : NSObject {
+}
+
+/*
+ optional sdk settings that should be called before start session
+ */
++ (void)setAppVersion:(NSString *)version; // override the app version
++ (NSString *)getFlurryAgentVersion; // get the Flurry Agent version number
++ (void)setShowErrorInLogEnabled:(BOOL)value; // default is NO
++ (void)setDebugLogEnabled:(BOOL)value; // generate debug logs for Flurry support, default is NO
++ (void)setSessionContinueSeconds:(int)seconds; // default is 10 seconds
++ (void)setSecureTransportEnabled:(BOOL)value; // set data to be sent over SSL, default is NO
+
+/*
+ start session, attempt to send saved sessions to server
+ */
++ (void)startSession:(NSString *)apiKey;
+
+/*
+ log events or errors after session has started
+ */
++ (void)logEvent:(NSString *)eventName;
++ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters;
++ (void)logError:(NSString *)errorID message:(NSString *)message exception:(NSException *)exception;
++ (void)logError:(NSString *)errorID message:(NSString *)message error:(NSError *)error;
+
+/*
+ start or end timed events
+ */
++ (void)logEvent:(NSString *)eventName timed:(BOOL)timed;
++ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters timed:(BOOL)timed;
++ (void)endTimedEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters; // non-nil parameters will update the parameters
+
+/*
+ count page views
+ */
++ (void)logAllPageViews:(id)target; // automatically track page view on UINavigationController or UITabBarController
++ (void)logPageView; // manually increment page view by 1
+
+/*
+ set user info
+ */
++ (void)setUserID:(NSString *)userID; // user's id in your system
++ (void)setAge:(int)age; // user's age in years
++ (void)setGender:(NSString *)gender; // user's gender m or f
+
+/*
+ set location information
+ */
++ (void)setLatitude:(double)latitude longitude:(double)longitude horizontalAccuracy:(float)horizontalAccuracy verticalAccuracy:(float)verticalAccuracy;
+
+/*
+ optional session settings that can be changed after start session
+ */
++ (void)setSessionReportsOnCloseEnabled:(BOOL)sendSessionReportsOnClose; // default is YES
++ (void)setSessionReportsOnPauseEnabled:(BOOL)setSessionReportsOnPauseEnabled; // default is NO
++ (void)setEventLoggingEnabled:(BOOL)value; // default is YES
+
+@end
Binary file not shown.
@@ -0,0 +1,52 @@
+//
+// LocalyticsDatabase.h
+// LocalyticsDemo
+//
+// Created by jkaufman on 5/26/11.
+// Copyright 2011 Localytics. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <sqlite3.h>
+
+@interface LocalyticsDatabase : NSObject {
+ sqlite3 *_databaseConnection;
+ NSRecursiveLock *_dbLock;
+ NSRecursiveLock *_transactionLock;
+}
+
++ (LocalyticsDatabase *)sharedLocalyticsDatabase;
+
+- (NSUInteger)databaseSize;
+- (int) eventCount;
+- (NSTimeInterval)createdTimestamp;
+
+- (BOOL)beginTransaction:(NSString *)name;
+- (BOOL)releaseTransaction:(NSString *)name;
+- (BOOL)rollbackTransaction:(NSString *)name;
+
+- (BOOL)incrementLastUploadNumber:(int *)uploadNumber;
+- (BOOL)incrementLastSessionNumber:(int *)sessionNumber;
+
+- (BOOL)addEventWithBlobString:(NSString *)blob;
+- (BOOL)addCloseEventWithBlobString:(NSString *)blob;
+- (BOOL)addFlowEventWithBlobString:(NSString *)blob;
+- (BOOL)removeLastCloseAndFlowEvents;
+
+- (BOOL)addHeaderWithSequenceNumber:(int)number blobString:(NSString *)blob rowId:(sqlite3_int64 *)insertedRowId;
+- (int)unstagedEventCount;
+- (BOOL)stageEventsForUpload:(sqlite3_int64)headerId;
+- (NSString *)uploadBlobString;
+- (BOOL)deleteUploadData;
+
+- (NSTimeInterval)lastSessionStartTimestamp;
+- (BOOL)setLastsessionStartTimestamp:(NSTimeInterval)timestamp;
+
+- (BOOL)isOptedOut;
+- (BOOL)setOptedOut:(BOOL)optOut;
+- (NSString *) installId;
+
+- (NSString *)customDimension:(int)dimension;
+- (BOOL)setCustomDimension:(int)dimension value:(NSString *)value;
+
+@end
Oops, something went wrong. Retry.

0 comments on commit 2609f85

Please sign in to comment.