[ios] Added secret keys for MRGS, fixed conflicts.

This commit is contained in:
Timur Bernikowich 2014-11-19 12:03:05 +03:00 committed by Alex Zolotarev
parent 6b6a258079
commit 7ee32426f6
8 changed files with 293 additions and 1520 deletions

View file

@ -103,9 +103,8 @@ void InitLocalizedStrings()
- (void)initMRGService
{
#warning App id and secret key are not set.
NSInteger appId = NSNotFound;
NSString * secret = @"test_key";
[MRGServiceInit MRGServiceWithAppId:appId andSecret:secret andDelegate:nil];
NSInteger appId = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"MRGServiceAppID"] integerValue];
NSString * secret = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MRGServiceClientKey"];
// MRGService settings
MRGServiceParams * mrgsParams = [[MRGServiceParams alloc] initWithAppId:appId andSecret:secret];
@ -114,7 +113,14 @@ void InitLocalizedStrings()
mrgsParams.crashReportEnabled = YES;
mrgsParams.allowPushNotificationHooks = YES;
NSArray * externalParams = @[];
// Google Analytics
// MRGSGoogleAnalyticsParams *googleAnalyticsParams = [[MRGSGoogleAnalyticsParams alloc] initWithTrackingId:@"***REMOVED***"];
// googleAnalyticsParams.enable = NO;
// googleAnalyticsParams.exceptionHandlerEnabled = YES;
// googleAnalyticsParams.logLevel = 0;
NSArray *externalParams = @[/*googleAnalyticsParams*/];
[MRGServiceInit startWithServiceParams:mrgsParams externalSDKParams:externalParams delegate:nil];
[[MRGSApplication currentApplication] markAsUpdatedWithRegistrationDate:[NSDate date]];
}

View file

@ -181,10 +181,8 @@
B00511BC1A1102FE00A61AA4 /* libMRAdMan.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511491A1102FE00A61AA4 /* libMRAdMan.a */; };
B00511BD1A1102FF00A61AA4 /* libAppsFlyerLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B005115E1A1102FE00A61AA4 /* libAppsFlyerLib.a */; };
B00511BE1A1102FF00A61AA4 /* Chartboost.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511601A1102FE00A61AA4 /* Chartboost.framework */; };
B00511BF1A11030000A61AA4 /* libFlurry_5.3.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511631A1102FE00A61AA4 /* libFlurry_5.3.0.a */; };
B00511C01A11030000A61AA4 /* libGoogleAnalyticsServices.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B005116F1A1102FE00A61AA4 /* libGoogleAnalyticsServices.a */; };
B00511C11A11030100A61AA4 /* libGoogleConversionTracking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511761A1102FE00A61AA4 /* libGoogleConversionTracking.a */; };
B00511C21A11030100A61AA4 /* libMobileAppTracker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511781A1102FE00A61AA4 /* libMobileAppTracker.a */; };
B00511C31A11030200A61AA4 /* libMyTracker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B005117B1A1102FE00A61AA4 /* libMyTracker.a */; };
B00511C41A11030200A61AA4 /* MRGService.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B00511811A1102FE00A61AA4 /* MRGService.framework */; };
CB252D6F16FF82C9001E41E9 /* Statistics.mm in Sources */ = {isa = PBXBuildFile; fileRef = CB252D6C16FF82C8001E41E9 /* Statistics.mm */; };
@ -1528,8 +1526,6 @@
B005115D1A1102FE00A61AA4 /* AppsFlyerTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppsFlyerTracker.h; sourceTree = "<group>"; };
B005115E1A1102FE00A61AA4 /* libAppsFlyerLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libAppsFlyerLib.a; sourceTree = "<group>"; };
B00511601A1102FE00A61AA4 /* Chartboost.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Chartboost.framework; sourceTree = "<group>"; };
B00511621A1102FE00A61AA4 /* Flurry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Flurry.h; sourceTree = "<group>"; };
B00511631A1102FE00A61AA4 /* libFlurry_5.3.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libFlurry_5.3.0.a; sourceTree = "<group>"; };
B00511651A1102FE00A61AA4 /* GAI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GAI.h; sourceTree = "<group>"; };
B00511661A1102FE00A61AA4 /* GAIDictionaryBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GAIDictionaryBuilder.h; sourceTree = "<group>"; };
B00511671A1102FE00A61AA4 /* GAIEcommerceFields.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GAIEcommerceFields.h; sourceTree = "<group>"; };
@ -1545,8 +1541,6 @@
B00511731A1102FE00A61AA4 /* GoogleConversionPing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoogleConversionPing.h; sourceTree = "<group>"; };
B00511751A1102FE00A61AA4 /* DCTReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCTReporter.h; sourceTree = "<group>"; };
B00511761A1102FE00A61AA4 /* libGoogleConversionTracking.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libGoogleConversionTracking.a; sourceTree = "<group>"; };
B00511781A1102FE00A61AA4 /* libMobileAppTracker.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMobileAppTracker.a; sourceTree = "<group>"; };
B00511791A1102FE00A61AA4 /* MobileAppTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileAppTracker.h; sourceTree = "<group>"; };
B005117B1A1102FE00A61AA4 /* libMyTracker.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMyTracker.a; sourceTree = "<group>"; };
B005117C1A1102FE00A61AA4 /* MCMyTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCMyTracker.h; sourceTree = "<group>"; };
B005117D1A1102FE00A61AA4 /* MRCustomParamsProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRCustomParamsProvider.h; sourceTree = "<group>"; };
@ -2202,14 +2196,12 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B00511C21A11030100A61AA4 /* libMobileAppTracker.a in Frameworks */,
B00511BC1A1102FE00A61AA4 /* libMRAdMan.a in Frameworks */,
B00511061A1101FC00A61AA4 /* CoreMedia.framework in Frameworks */,
B00511C31A11030200A61AA4 /* libMyTracker.a in Frameworks */,
B00511041A1101F600A61AA4 /* CoreData.framework in Frameworks */,
B00511021A1101E000A61AA4 /* AVFoundation.framework in Frameworks */,
B00511011A1101AA00A61AA4 /* libz.dylib in Frameworks */,
B00511BF1A11030000A61AA4 /* libFlurry_5.3.0.a in Frameworks */,
B00510FF1A1101A000A61AA4 /* libxml2.dylib in Frameworks */,
B00510FD1A11019400A61AA4 /* libsqlite3.dylib in Frameworks */,
B00510FB1A11015900A61AA4 /* CFNetwork.framework in Frameworks */,
@ -2591,10 +2583,8 @@
B00511481A1102FE00A61AA4 /* Adman */,
B005115C1A1102FE00A61AA4 /* AppsFlyer */,
B005115F1A1102FE00A61AA4 /* Chartboost */,
B00511611A1102FE00A61AA4 /* Flurry */,
B00511641A1102FE00A61AA4 /* GoogleAnalytics */,
B00511701A1102FE00A61AA4 /* GoogleConversionTracking */,
B00511771A1102FE00A61AA4 /* MobileAppTracking */,
B005117A1A1102FE00A61AA4 /* MyTracker */,
);
path = ExternalLibs;
@ -2643,15 +2633,6 @@
path = Chartboost;
sourceTree = "<group>";
};
B00511611A1102FE00A61AA4 /* Flurry */ = {
isa = PBXGroup;
children = (
B00511621A1102FE00A61AA4 /* Flurry.h */,
B00511631A1102FE00A61AA4 /* libFlurry_5.3.0.a */,
);
path = Flurry;
sourceTree = "<group>";
};
B00511641A1102FE00A61AA4 /* GoogleAnalytics */ = {
isa = PBXGroup;
children = (
@ -2697,15 +2678,6 @@
path = DoubleClick;
sourceTree = "<group>";
};
B00511771A1102FE00A61AA4 /* MobileAppTracking */ = {
isa = PBXGroup;
children = (
B00511781A1102FE00A61AA4 /* libMobileAppTracker.a */,
B00511791A1102FE00A61AA4 /* MobileAppTracker.h */,
);
path = MobileAppTracking;
sourceTree = "<group>";
};
B005117A1A1102FE00A61AA4 /* MyTracker */ = {
isa = PBXGroup;
children = (
@ -5127,6 +5099,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me dbg";
SDKROOT = iphoneos;
@ -5241,6 +5214,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me dbg lite";
SDKROOT = iphoneos;
@ -5312,6 +5286,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = maps.me;
SDKROOT = iphoneos;
@ -5412,6 +5387,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me dbg lite";
SDKROOT = iphoneos;
@ -5516,6 +5492,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me beta lite";
SDKROOT = iphoneos;
@ -5615,6 +5592,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me dbg";
SDKROOT = iphoneos;
@ -5819,6 +5797,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me beta";
SDKROOT = iphoneos;
@ -5923,6 +5902,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = maps.me;
SDKROOT = iphoneos;
@ -6026,6 +6006,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me rel lite";
SDKROOT = iphoneos;
@ -6129,6 +6110,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me rel";
SDKROOT = iphoneos;
@ -6231,6 +6213,7 @@
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PRODUCT_NAME = "maps.me rel";
SDKROOT = iphoneos;
@ -6294,6 +6277,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Simulator Full Release";
@ -6318,6 +6325,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Simulator Lite";
@ -6342,6 +6373,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Simulator Full";
@ -6366,6 +6421,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Debug Lite";
@ -6390,6 +6469,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Debug Full";
@ -6414,6 +6517,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "AdHoc Lite";
@ -6438,6 +6565,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Release Lite";
@ -6462,6 +6613,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "AdHoc Full";
@ -6486,6 +6661,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Release Full";
@ -6510,6 +6709,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Production Lite";
@ -6534,6 +6757,30 @@
"${SRCROOT}/Statistics",
"${SRCROOT}",
);
OTHER_LDFLAGS = (
"-lstats_client",
"-lmap",
"-lsearch",
"-lgui",
"-lgraphics",
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
"-lbase",
"-lfreetype",
"-lfribidi",
"-lzlib",
"-ljansson",
"-ltomcrypt",
"-lexpat",
"-lprotobuf",
"-losrm",
"-ObjC",
);
PROVISIONING_PROFILE = "";
};
name = "Production Full";

View file

@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MRGServiceClientKey</key>
<string>***REMOVED***</string>
<key>MRGServiceAppID</key>
<integer>147</integer>
<key>AarkiClientSecurityKey</key>
<string>lN96dHHOKoi6mGD5NtsFx8NmuQqM</string>
<key>CFBundleDevelopmentRegion</key>

View file

@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MRGServiceClientKey</key>
<string>***REMOVED***</string>
<key>MRGServiceAppID</key>
<integer>148</integer>
<key>AarkiClientSecurityKey</key>
<string>2mWtcnLWDuXgdKEhYLmatwh3cby3</string>
<key>CFBundleDevelopmentRegion</key>

View file

@ -1,818 +0,0 @@
//
// Flurry.h
// Flurry iOS Analytics Agent
//
// Copyright 2009-2012 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.
*
* @note This class provides methods necessary for correct function of FlurryAds.h.
* For information on how to use Flurry's Ads SDK to
* attract high-quality users and monetize your user base see <a href="http://support.flurry.com/index.php?title=Publishers">Support Center - Publishers</a>.
*
* @author 2009 - 2013 Flurry, Inc. All Rights Reserved.
* @version 4.3.0
*
*/
/*!
* @brief Enum for setting up log output level.
* @since 4.2.0
*
*/
typedef enum {
FlurryLogLevelNone = 0, //No output
FlurryLogLevelCriticalOnly, //Default, outputs only critical log events
FlurryLogLevelDebug, //Debug level, outputs critical and main log events
FlurryLogLevelAll //Highest level, outputs all log events
} FlurryLogLevel;
@interface Flurry : NSObject {
}
/** @name Pre-Session Calls
* Optional sdk settings that should be called before start session.
*/
//@{
/*!
* @brief Explicitly specifies the App Version that Flurry will use to group Analytics data.
* @since 2.7
*
* This is an optional method that overrides the App Version Flurry uses for reporting. Flurry will
* use the CFBundleVersion in your info.plist file when this method is not invoked.
*
* @note There is a maximum of 605 versions allowed for a single app. \n
* This method must be called prior to invoking #startSession:.
*
* @param version The custom version name.
*/
+ (void)setAppVersion:(NSString *)version;
/*!
* @brief Retrieves the Flurry Agent Build Version.
* @since 2.7
*
* This is an optional method that retrieves the Flurry Agent Version the app is running under.
* It is most often used if reporting an unexpected behavior of the SDK to <a href="mailto:iphonesupport@flurry.com">
* Flurry Support</a>
*
* @note This method must be called prior to invoking #startSession:. \n
* FAQ for the iPhone SDK is located at <a href="http://wiki.flurry.com/index.php?title=IPhone_FAQ">
* Support Center - iPhone FAQ</a>.
*
* @see #setLogLevel: for information on how to view debugging information on your console.
*
* @return The agent version of the Flurry SDK.
*
*/
+ (NSString *)getFlurryAgentVersion;
/*!
* @brief Displays an exception in the debug log if thrown during a Session.
* @since 2.7
*
* This is an optional method that augments the debug logs with exceptions that occur during the session.
* You must both capture exceptions to Flurry and set debug logging to enabled for this method to
* display information to the console. The default setting for this method is @c NO.
*
* @note This method must be called prior to invoking #startSession:.
*
* @see #setLogLevel: for information on how to view debugging information on your console. \n
* #logError:message:exception: for details on logging exceptions. \n
* #logError:message:error: for details on logging errors.
*
* @param value @c YES to show errors in debug logs, @c NO to omit errors in debug logs.
*/
+ (void)setShowErrorInLogEnabled:(BOOL)value;
/*!
* @brief Generates debug logs to console.
* @since 2.7
*
* This is an optional method that displays debug information related to the Flurry SDK.
* display information to the console. The default setting for this method is @c NO
* which sets the log level to @c FlurryLogLevelCriticalOnly.
* When set to @c YES the debug log level is set to @c FlurryLogLevelDebug
*
* @note This method must be called prior to invoking #startSession:. If the method, setLogLevel is called later in the code, debug logging will be automatically enabled.
*
* @param value @c YES to show debug logs, @c NO to omit debug logs.
*
*/
+ (void)setDebugLogEnabled:(BOOL)value;
/*!
* @brief Generates debug logs to console.
* @since 4.2.2
*
* This is an optional method that displays debug information related to the Flurry SDK.
* display information to the console. The default setting for this method is @c FlurryLogLevelCritycalOnly.
*
* @note Its good practice to call this method prior to invoking #startSession:. If debug logging is disabled earlier, this method will enable it.
*
* @param value Log level
*
*/
+ (void)setLogLevel:(FlurryLogLevel)value;
/*!
* @brief Set the timeout for expiring a Flurry session.
* @since 2.7
*
* This is an optional method that sets the time the app may be in the background before
* starting a new session upon resume. The default value for the session timeout is 10
* seconds in the background.
*
* @note This method must be called prior to invoking #startSession:.
*
* @param seconds The time in seconds to set the session timeout to.
*/
+ (void)setSessionContinueSeconds:(int)seconds;
/*!
* @brief Send data over a secure transport.
* @since 3.0
*
* This is an optional method that sends data over an SSL connection when enabled. The
* default value is @c NO.
*
* @note This method must be called prior to invoking #startSession:.
*
* @param value @c YES to send data over secure connection.
*/
+ (void)setSecureTransportEnabled:(BOOL)value;
/*!
* @brief Enable automatic collection of crash reports.
* @since 4.1
*
* This is an optional method that collects crash reports when enabled. The
* default value is @c NO.
*
* @note This method must be called prior to invoking #startSession:.
*
* @param value @c YES to enable collection of crash reports.
*/
+ (void)setCrashReportingEnabled:(BOOL)value;
//@}
/*!
* @brief Start a Flurry session for the project denoted by @c apiKey.
* @since 2.6
*
* This method serves as the entry point to Flurry Analytics collection. It must be
* called in the scope of @c applicationDidFinishLaunching. The session will continue
* for the period the app is in the foreground until your app is backgrounded for the
* time specified in #setSessionContinueSeconds:. If the app is resumed in that period
* the session will continue, otherwise a new session will begin.
*
* Crash reporting will not be enabled. See #setCrashReportingEnabled: for
* more information.
*
* @note If testing on a simulator, please be sure to send App to background via home
* button. Flurry depends on the iOS lifecycle to be complete for full reporting.
*
* @see #setSessionContinueSeconds: for details on setting a custom session timeout.
*
* @code
* - (void)applicationDidFinishLaunching:(UIApplication *)application
{
// Optional Flurry startup methods
[Flurry startSession:@"YOUR_API_KEY"];
// ....
}
* @endcode
*
* @param apiKey The API key for this project.
*/
+ (void)startSession:(NSString *)apiKey;
/*!
* @brief Start a Flurry session for the project denoted by @c apiKey.
* @since 4.0.8
*
* This method serves as the entry point to Flurry Analytics collection. It must be
* called in the scope of @c applicationDidFinishLaunching passing in the launchOptions param.
* The session will continue
* for the period the app is in the foreground until your app is backgrounded for the
* time specified in #setSessionContinueSeconds:. If the app is resumed in that period
* the session will continue, otherwise a new session will begin.
*
* @note If testing on a simulator, please be sure to send App to background via home
* button. Flurry depends on the iOS lifecycle to be complete for full reporting.
*
* @see #setSessionContinueSeconds: for details on setting a custom session timeout.
*
* @code
* - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
[Flurry startSession:@"YOUR_API_KEY" withOptions:launchOptions];
// ....
}
* @endcode
*
* @param apiKey The API key for this project.
* @param options passed launchOptions from the applicatin's didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
*/
+ (void) startSession:(NSString *)apiKey withOptions:(id)options;
/*!
* @brief Pauses a Flurry session left running in background.
* @since 4.2.2
*
* This method should be used in case of #setBackgroundSessionEnabled: set to YES. It can be
* called when application finished all background tasks (such as playing music) to pause session.
*
* @see #setBackgroundSessionEnabled: for details on setting a custom behaviour on resigning activity.
*
* @code
* - (void)allBackgroundTasksFinished
{
// ....
[Flurry pauseBackgroundSession];
// ....
}
* @endcode
*
*/
+ (void)pauseBackgroundSession;
/*!
* @brief Adds an SDK origin specified by @c originName and @c originVersion.
* @since 5.0.0
*
* This method allows you to specify origin within your Flurry SDK wrapper. As a general rule
* you should capture all the origin info related to your wrapper for Flurry SDK after every session start.
*
* @see #addOrigin:withVersion:withParameters: for details on reporting origin info with parameters. \n
*
* @code
* - (void)interestingSDKWrapperLibraryfunction
{
// ... after calling startSession
[Flurry addOrigin:@"Interesting_Wrapper" withVersion:@"1.0.0"];
// more code ...
}
* @endcode
*
* @param originName Name of the origin.
* @param originVersion Version string of the origin wrapper
*/
+ (void)addOrigin:(NSString *)originName withVersion:(NSString*)originVersion;
/*!
* @brief Adds a custom parameterized origin specified by @c originName with @c originVersion and @c parameters.
* @since 5.0.0
*
* This method overrides #addOrigin to allow you to associate parameters with an origin attribute. Parameters
* are valuable as they allow you to store characteristics of an origin.
*
* @note You should not pass private or confidential information about your origin info in a
* custom origin. \n
* A maximum of 9 parameter names may be associated with any origin. Sending
* over 10 parameter names with a single origin will result in no parameters being logged
* for that origin.
*
*
* @code
* - (void)userPurchasedSomethingCool
{
NSDictionary *params =
[NSDictionary dictionaryWithObjectsAndKeys:@"Origin Info Item", // Parameter Value
@"Origin Info Item Key", // Parameter Name
nil];
// ... after calling startSession
[Flurry addOrigin:@"Interesting_Wrapper" withVersion:@"1.0.0"];
// more code ...
}
* @endcode
*
* @param originName Name of the origin.
* @param originVersion Version string of the origin wrapper
* @param parameters An immutable copy of map containing Name-Value pairs of parameters.
*/
+ (void)addOrigin:(NSString *)originName withVersion:(NSString*)originVersion withParameters:(NSDictionary *)parameters;
/** @name Event and Error Logging
* Methods for reporting custom events and errors during the session.
*/
//@{
/*!
* @brief Records a custom event specified by @c eventName.
* @since 2.8.4
*
* This method allows you to specify custom events within your app. As a general rule
* you should capture events related to user navigation within your app, any action
* around monetization, and other events as they are applicable to tracking progress
* towards your business goals.
*
* @note You should not pass private or confidential information about your users in a
* custom event. \n
* Where applicable, you should make a concerted effort to use timed events with
* parameters (#logEvent:withParameters:timed:) or events with parameters
* (#logEvent:withParameters:). This provides valuable information around the time the user
* spends within an action (e.g. - time spent on a level or viewing a page) or characteristics
* of an action (e.g. - Buy Event that has a Parameter of Widget with Value Golden Sword).
*
* @see #logEvent:withParameters: for details on storing events with parameters. \n
* #logEvent:timed: for details on storing timed events. \n
* #logEvent:withParameters:timed: for details on storing timed events with parameters. \n
* #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating
* parameters.
*
* @code
* - (void)interestingAppAction
{
[Flurry logEvent:@"Interesting_Action"];
// Perform interesting action
}
* @endcode
*
* @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme
* that can be easily understood by non-technical people in your business domain.
*/
+ (void)logEvent:(NSString *)eventName;
/*!
* @brief Records a custom parameterized event specified by @c eventName with @c parameters.
* @since 2.8.4
*
* This method overrides #logEvent to allow you to associate parameters with an event. Parameters
* are extremely valuable as they allow you to store characteristics of an action. For example,
* if a user purchased an item it may be helpful to know what level that user was on.
* By setting this parameter you will be able to view a distribution of levels for the purcahsed
* event on the <a href="http://dev.flurry.com">Flurrly Dev Portal</a>.
*
* @note You should not pass private or confidential information about your users in a
* custom event. \n
* A maximum of 10 parameter names may be associated with any event. Sending
* over 10 parameter names with a single event will result in no parameters being logged
* for that event. You may specify an infinite number of Parameter values. For example,
* a Search Box would have 1 parameter name (e.g. - Search Box) and many values, which would
* allow you to see what values users look for the most in your app. \n
* Where applicable, you should make a concerted effort to use timed events with
* parameters (#logEvent:withParameters:timed:). This provides valuable information
* around the time the user spends within an action (e.g. - time spent on a level or
* viewing a page).
*
* @see #logEvent:withParameters:timed: for details on storing timed events with parameters. \n
* #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating
* parameters.
*
* @code
* - (void)userPurchasedSomethingCool
{
NSDictionary *params =
[NSDictionary dictionaryWithObjectsAndKeys:@"Cool Item", // Parameter Value
@"Item Purchased", // Parameter Name
nil];
[Flurry logEvent:@"Something Cool Purchased" withParameters:params];
// Give user cool item
}
* @endcode
*
* @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme
* that can be easily understood by non-technical people in your business domain.
* @param parameters An immutable copy of map containing Name-Value pairs of parameters.
*/
+ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters;
/*!
* @brief Records an app exception. Commonly used to catch unhandled exceptions.
* @since 2.7
*
* This method captures an exception for reporting to Flurry. We recommend adding an uncaught
* exception listener to capture any exceptions that occur during usage that is not
* anticipated by your app.
*
* @see #logError:message:error: for details on capturing errors.
*
* @code
* - (void) uncaughtExceptionHandler(NSException *exception)
{
[Flurry logError:@"Uncaught" message:@"Crash!" exception:exception];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
[Flurry startSession:@"YOUR_API_KEY"];
// ....
}
* @endcode
*
* @param errorID Name of the error.
* @param message The message to associate with the error.
* @param exception The exception object to report.
*/
+ (void)logError:(NSString *)errorID message:(NSString *)message exception:(NSException *)exception;
/*!
* @brief Records an app error.
* @since 2.7
*
* This method captures an error for reporting to Flurry.
*
* @see #logError:message:exception: for details on capturing exceptions.
*
* @code
* - (void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
[Flurry logError:@"WebView No Load" message:[error localizedDescription] error:error];
}
* @endcode
*
* @param errorID Name of the error.
* @param message The message to associate with the error.
* @param error The error object to report.
*/
+ (void)logError:(NSString *)errorID message:(NSString *)message error:(NSError *)error;
/*!
* @brief Records a timed event specified by @c eventName.
* @since 2.8.4
*
* This method overrides #logEvent to allow you to capture the length of an event. This can
* be extremely valuable to understand the level of engagement with a particular action. For
* example, you can capture how long a user spends on a level or reading an article.
*
* @note You should not pass private or confidential information about your users in a
* custom event. \n
* Where applicable, you should make a concerted effort to use parameters with your timed
* events (#logEvent:withParameters:timed:). This provides valuable information
* around the characteristics of an action (e.g. - Buy Event that has a Parameter of Widget with
* Value Golden Sword).
*
* @see #logEvent:withParameters:timed: for details on storing timed events with parameters. \n
* #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating
* parameters.
*
* @code
* - (void)startLevel
{
[Flurry logEvent:@"Level Played" timed:YES];
// Start user on level
}
- (void)endLevel
{
[Flurry endTimedEvent:@"Level Played" withParameters:nil];
// User done with level
}
* @endcode
*
* @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme
* that can be easily understood by non-technical people in your business domain.
* @param timed Specifies the event will be timed.
*/
+ (void)logEvent:(NSString *)eventName timed:(BOOL)timed;
/*!
* @brief Records a custom parameterized timed event specified by @c eventName with @c parameters.
* @since 2.8.4
*
* This method overrides #logEvent to allow you to capture the length of an event with parameters.
* This can be extremely valuable to understand the level of engagement with a particular action
* and the characteristics associated with that action. For example, you can capture how long a user
* spends on a level or reading an article. Parameters can be used to capture, for example, the
* author of an article or if something was purchased while on the level.
*
* @note You should not pass private or confidential information about your users in a
* custom event.
*
* @see #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating
* parameters.
*
* @code
* - (void)startLevel
{
NSDictionary *params =
[NSDictionary dictionaryWithObjectsAndKeys:@"100", // Parameter Value
@"Current Points", // Parameter Name
nil];
[Flurry logEvent:@"Level Played" withParameters:params timed:YES];
// Start user on level
}
- (void)endLevel
{
// User gained additional 100 points in Level
NSDictionary *params =
[NSDictionary dictionaryWithObjectsAndKeys:@"200", // Parameter Value
@"Current Points", // Parameter Name
nil];
[Flurry endTimedEvent:@"Level Played" withParameters:params];
// User done with level
}
* @endcode
*
* @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme
* that can be easily understood by non-technical people in your business domain.
* @param parameters An immutable copy of map containing Name-Value pairs of parameters.
* @param timed Specifies the event will be timed.
*/
+ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters timed:(BOOL)timed;
/*!
* @brief Ends a timed event specified by @c eventName and optionally updates parameters with @c parameters.
* @since 2.8.4
*
* This method ends an existing timed event. If parameters are provided, this will overwrite existing
* parameters with the same name or create new parameters if the name does not exist in the parameter
* map set by #logEvent:withParameters:timed:.
*
* @note You should not pass private or confidential information about your users in a
* custom event. \n
* If the app is backgrounded prior to ending a timed event, the Flurry SDK will automatically
* end the timer on the event. \n
* #endTimedEvent:withParameters: is ignored if called on a previously
* terminated event.
*
* @see #logEvent:withParameters:timed: for details on starting a timed event with parameters.
*
* @code
* - (void)startLevel
{
NSDictionary *params =
[NSDictionary dictionaryWithObjectsAndKeys:@"100", // Parameter Value
@"Current Points", // Parameter Name
nil];
[Flurry logEvent:@"Level Played" withParameters:params timed:YES];
// Start user on level
}
- (void)endLevel
{
// User gained additional 100 points in Level
NSDictionary *params =
[NSDictionary dictionaryWithObjectsAndKeys:@"200", // Parameter Value
@"Current Points", // Parameter Name
nil];
[Flurry endTimedEvent:@"Level Played" withParameters:params];
// User done with level
}
* @endcode
*
* @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme
* that can be easily understood by non-technical people in your business domain.
* @param parameters An immutable copy of map containing Name-Value pairs of parameters.
*/
+ (void)endTimedEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters; // non-nil parameters will update the parameters
//@}
/** @name Page View Methods
* Count page views.
*/
//@{
/*!
* @deprecated
* @brief see +(void)logAllPageViewsForTarget:(id)target; for details
* @since 2.7
* This method does the same as +(void)logAllPageViewsForTarget:(id)target method and is left for backward compatibility
*/
+ (void)logAllPageViews:(id)target __attribute__ ((deprecated));
/*!
* @brief Automatically track page views on a @c UINavigationController or @c UITabBarController.
* @since 4.3
*
* This method increments the page view count for a session based on traversing a UINavigationController
* or UITabBarController. The page view count is only a counter for the number of transitions in your
* app. It does not associate a name with the page count. To associate a name with a count of occurences
* see #logEvent:.
*
* @note If you need to release passed target, you should call counterpart method + (void)stopLogPageViewsForTarget:(id)target before;
*
* @see #logPageView for details on explictly incrementing page view count.
*
* @code
* -(void) trackViewsFromTabBar:(UITabBarController*) tabBar
{
[Flurry logAllPageViewsForTarget:tabBar];
}
* @endcode
*
* @param target The navigation or tab bar controller.
*/
+ (void)logAllPageViewsForTarget:(id)target;
/*!
* @brief Stops logging page views on previously observed with logAllPageViewsForTarget: @c UINavigationController or @c UITabBarController.
* @since 4.3
*
* Call this method before instance of @c UINavigationController or @c UITabBarController observed with logAllPageViewsForTarget: is released.
*
* @code
* -(void) dealloc
{
[Flurry stopLogPageViewsForTarget:_tabBarController];
[_tabBarController release];
[super dealloc];
}
* @endcode
*
* @param target The navigation or tab bar controller.
*/
+ (void)stopLogPageViewsForTarget:(id)target;
/*!
* @brief Explicitly track a page view during a session.
* @since 2.7
*
* This method increments the page view count for a session when invoked. It does not associate a name
* with the page count. To associate a name with a count of occurences see #logEvent:.
*
* @see #logAllPageViews for details on automatically incrementing page view count based on user
* traversing navigation or tab bar controller.
*
* @code
* -(void) trackView
{
[Flurry logPageView];
}
* @endcode
*
*/
+ (void)logPageView;
//@}
/** @name User Info
* Methods to set user information.
*/
//@{
/*!
* @brief Assign a unique id for a user in your app.
* @since 2.7
*
* @note Please be sure not to use this method to pass any private or confidential information
* about the user.
*
* @param userID The app id for a user.
*/
+ (void)setUserID:(NSString *)userID;
/*!
* @brief Set your user's age in years.
* @since 2.7
*
* Use this method to capture the age of your user. Only use this method if you collect this
* information explictly from your user (i.e. - there is no need to set a default value).
*
* @note The age is aggregated across all users of your app and not available on a per user
* basis.
*
* @param age Reported age of user.
*
*/
+ (void)setAge:(int)age;
/*!
* @brief Set your user's gender.
* @since 2.7
*
* Use this method to capture the gender of your user. Only use this method if you collect this
* information explictly from your user (i.e. - there is no need to set a default value). Allowable
* values are @c @"m" or @c @"f"
*
* @note The gender is aggregated across all users of your app and not available on a per user
* basis.
*
* @param gender Reported gender of user.
*
*/
+ (void)setGender:(NSString *)gender; // user's gender m or f
//@}
/** @name Location Reporting
* Methods for setting location information.
*/
//@{
/*!
* @brief Set the location of the session.
* @since 2.7
*
* Use information from the CLLocationManager to specify the location of the session. Flurry does not
* automatically track this information or include the CLLocation framework.
*
* @note Only the last location entered is captured per session. \n
* Regardless of accuracy specified, the Flurry SDK will only report location at city level or higher. \n
* Location is aggregated across all users of your app and not available on a per user basis. \n
* This information should only be captured if it is germaine to the use of your app.
*
* @code
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
[locationManager startUpdatingLocation];
* @endcode
*
* After starting the location manager, you can set the location with Flurry. You can implement
* CLLocationManagerDelegate to be aware of when the location is updated. Below is an example
* of how to use this method, after you have recieved a location update from the locationManager.
*
* @code
CLLocation *location = locationManager.location;
[Flurry setLatitude:location.coordinate.latitude
longitude:location.coordinate.longitude
horizontalAccuracy:location.horizontalAccuracy
verticalAccuracy:location.verticalAccuracy];
* @endcode
* @param latitude The latitude.
* @param longitude The longitude.
* @param horizontalAccuracy The radius of uncertainty for the location in meters.
* @param verticalAccuracy The accuracy of the altitude value in meters.
*
*/
+ (void)setLatitude:(double)latitude longitude:(double)longitude horizontalAccuracy:(float)horizontalAccuracy verticalAccuracy:(float)verticalAccuracy;
//@}
/** @name Session Reporting Calls
* Optional methods that can be called at any point to control session reporting.
*/
//@{
/*!
* @brief Set session to report when app closes.
* @since 2.7
*
* Use this method report session data when the app is closed. The default value is @c YES.
*
* @note This method is rarely invoked in iOS >= 3.2 due to the updated iOS lifecycle.
*
* @see #setSessionReportsOnPauseEnabled:
*
* @param sendSessionReportsOnClose YES to send on close, NO to omit reporting on close.
*
*/
+ (void)setSessionReportsOnCloseEnabled:(BOOL)sendSessionReportsOnClose;
/*!
* @brief Set session to report when app is sent to the background.
* @since 2.7
*
* Use this method report session data when the app is paused. The default value is @c YES.
*
* @param setSessionReportsOnPauseEnabled YES to send on pause, NO to omit reporting on pause.
*
*/
+ (void)setSessionReportsOnPauseEnabled:(BOOL)setSessionReportsOnPauseEnabled;
/*!
* @brief Set session to support background execution.
* @since 4.2.2
*
* Use this method to enable reporting of errors and events when application is
* running in backgorund (such applications have UIBackgroundModes in Info.plist).
* You should call #pauseBackgroundSession when appropriate in background mode to
* pause the session (for example when played song completed in background)
*
* Default value is @c NO
*
* @see #pauseBackgroundSession for details
*
* @param setBackgroundSessionEnabled YES to enbale background support and
* continue log events and errors for running session.
*/
+ (void)setBackgroundSessionEnabled:(BOOL)setBackgroundSessionEnabled;
/*!
* @brief Enable custom event logging.
* @since 2.7
*
* Use this method to allow the capture of custom events. The default value is @c YES.
*
* @param value YES to enable event logging, NO to stop custom logging.
*
*/
+ (void)setEventLoggingEnabled:(BOOL)value;
//@}
@end

View file

@ -1,670 +0,0 @@
//
// MobileAppTracker.h
// MobileAppTracker
//
// Created by HasOffers on 10/30/13.
// Copyright (c) 2013 HasOffers. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#define MATVERSION @"2.7.1"
@protocol MobileAppTrackerDelegate;
/*!
MobileAppTracker provides the methods to send events and actions to the
HasOffers servers.
*/
@interface MobileAppTracker : NSObject
#pragma mark - MATGender
/** @name Gender type constants */
typedef enum {
MATGenderMale=0, // Gender type MALE. Equals 0.
MATGenderFemale=1, // Gender type FEMALE. Equals 1.
MAT_GENDER_MALE=MATGenderMale, // Backward-compatible alias for MATGenderMale.
MAT_GENDER_FEMALE=MATGenderFemale // Backward-compatible alias for MATGenderFemale.
} MATGender;
#pragma mark - MobileAppTracker Shared Instance
/** @name MobileAppTracker Shared Instance */
/*!
A singleton of the MobileAppTracker class
*/
+ (MobileAppTracker *)sharedManager;
#pragma mark - Main Initializer
/** @name Intitializing MobileAppTracker With Advertiser Information */
/*!
Starts Mobile App Tracker with MAT Advertiser Id and MAT Conversion Key. Both values are required.
@param aid the MAT Advertiser Id provided in Mobile App Tracking.
@param key the MAT Conversion Key provided in Mobile App Tracking.
@return YES if error occurs, NO otherwise.
*/
- (BOOL)startTrackerWithMATAdvertiserId:(NSString *)aid MATConversionKey:(NSString *)key;
#pragma mark - Properties
/** @name MAT SDK Callback Delegate */
/*!
[MobileAppTrackerDelegate](MobileAppTrackerDelegate) : A Delegate used by MobileAppTracker to callback.
Set this to receive success and failure callbacks from the MAT SDK.
*/
@property (nonatomic, assign) id <MobileAppTrackerDelegate> delegate;
/** @name MAT Data Parameters */
/*!
Provides a view of the parameters used by the sdk at any time.
*/
@property (nonatomic, readonly) NSDictionary *sdkDataParameters;
#pragma mark - Debug And Test
/** @name Debug And Test */
/*!
Specifies that the server responses should include debug information.
@warning This is only for testing. You must turn this off for release builds.
@param yesorno defaults to NO.
*/
- (void)setDebugMode:(BOOL)yesorno;
/*!
Set to YES to allow duplicate requests to be registered with the MAT server.
@warning This is only for testing. You must turn this off for release builds.
@param yesorno defaults to NO.
*/
- (void)setAllowDuplicateRequests:(BOOL)yesorno;
#pragma mark - Data Parameters
/** @name Setter Methods */
/*!
Set the Apple Advertising Identifier available in iOS 6.
@param appleAdvertisingIdentifier - Apple Advertising Identifier
*/
- (void)setAppleAdvertisingIdentifier:(NSUUID *)appleAdvertisingIdentifier;
/*!
Set the Apple Vendor Identifier available in iOS 6.
@param appleVendorIdentifier - Apple Vendor Identifier
*/
- (void)setAppleVendorIdentifier:(NSUUID * )appleVendorIdentifier;
/*!
Sets the currency code.
Default: USD
@param currencyCode The string name for the currency code.
*/
- (void)setCurrencyCode:(NSString *)currencyCode;
/*!
Sets the jailbroken device flag.
@param yesorno The jailbroken device flag.
*/
- (void)setJailbroken:(BOOL)yesorno;
/*!
Sets the MAT advertiser id.
@param advertiserId The string id for the MAT advertiser id.
*/
- (void)setMATAdvertiserId:(NSString *)advertiserId __deprecated;
/*!
Sets the MAT conversion key.
@warning This should be set when startTracker is called and not modified thereafter.
@param conversionKey The string value for the MAT conversion key.
*/
- (void)setMATConversionKey:(NSString *)conversionKey __deprecated;
/*!
Sets the package name (bundle_id).
Defaults to the Bundle Id of the app that is running the sdk.
@param packageName The string name for the package.
*/
- (void)setPackageName:(NSString *)packageName;
/*!
Specifies if the sdk should auto detect if the iOS device is jailbroken.
YES/NO
@param yesorno YES will detect if the device is jailbroken, defaults to YES.
*/
- (void)setShouldAutoDetectJailbroken:(BOOL)yesorno;
/*!
Specifies if the sdk should pull the Apple Vendor Identifier from the device.
YES/NO
@param yesorno YES will set the Apple Vendor Identifier, defaults to NO.
*/
- (void)setShouldAutoGenerateAppleVendorIdentifier:(BOOL)yesorno;
/*!
Sets the MAC address.
@param macAddress mac address, defaults to nil.
*/
- (void)setMACAddress:(NSString *)macAddress __deprecated;
/*!
Sets the ODIN-1.
@param odin1 ODIN-1, defaults to nil.
*/
- (void)setODIN1:(NSString *)odin1 __deprecated;
/*!
Sets the OpenUDID.
@param openUDID OpenUDID, defaults to nil.
*/
- (void)setOpenUDID:(NSString *)openUDID __deprecated;
/*!
Sets the site id.
@param siteId The string id for the site id.
*/
- (void)setSiteId:(NSString *)siteId;
/*!
Set the Trusted Preference Identifier (TPID).
@param trusteTPID - Trusted Preference Identifier (TPID)
*/
- (void)setTrusteTPID:(NSString *)trusteTPID;
/*!
Sets the user id.
@param userId The string name for the user id.
*/
- (void)setUserId:(NSString *)userId;
/*!
Set user's Facebook ID.
@param facebookUserId string containing the user's Facebook user ID.
*/
- (void)setFacebookUserId:(NSString *)facebookUserId;
/*!
Set user's Twitter ID.
@param twitterUserId string containing the user's Twitter user ID.
*/
- (void)setTwitterUserId:(NSString *)twitterUserId;
/*!
Set user's Google ID.
@param googleUserId string containing the user's Google user ID.
*/
- (void)setGoogleUserId:(NSString *)googleUserId;
/*!
Sets the UIID. UIID is a replacement of the deprecated UDID in iOS for Asia and Japan.
Ref: https://github.com/akisute/UIApplication-UIID
@param uiid UIID, defaults to nil.
*/
- (void)setUIID:(NSString *)uiid __deprecated;
/*!
Sets the user's age.
@param userAge user's age
*/
- (void)setAge:(NSInteger)userAge;
/*!
Sets the user's gender.
@param userGender user's gender, possible values MATGenderMale, MATGenderFemale
*/
- (void)setGender:(MATGender)userGender;
/*!
Sets the user's location.
@param latitude user's latitude
@param longitude user's longitude
*/
- (void)setLatitude:(double)latitude longitude:(double)longitude;
/*!
Sets the user's location including altitude.
@param latitude user's latitude
@param longitude user's longitude
@param altitude user's altitude
*/
- (void)setLatitude:(double)latitude longitude:(double)longitude altitude:(double)altitude;
/*!
Set app-level ad-tracking.
YES/NO
@param enable YES means opt-in, NO means opt-out.
*/
- (void)setAppAdTracking:(BOOL)enable;
/*!
Set the name of plugin used, if any.
@param pluginName
*/
- (void)setPluginName:(NSString *)pluginName;
#pragma mark - Show iAd advertising
/** @name iAd advertising */
/*!
Display an iAd banner in a parent view. The parent view will be faded in and out
when an iAd is received or failed to display. The MobileAppTracker's delegate
object will receive notifications when this happens.
*/
- (void) displayiAdInView:(UIView *)view;
/*!
Removes the currently displayed iAd, if any.
*/
- (void) removeiAd;
#pragma mark - Track Install/Update Methods
/** @name Track Installs and/or Updates */
/*!
Record an Install or an Update by determining if a previous
version of this app is already installed on the user's device.
To be used if this is the first version of the app
or the previous version also included MAT sdk.
To be called when an app opens; typically in the didFinishLaunching event.
Works only once per app version, does not have any effect if called again in the same app version.
*/
- (void)trackInstall;
/*!
Record an Install or an Update by determining if a previous
version of this app is already installed on the user's device.
To be used if this is the first version of the app
or the previous version also included MAT sdk.
To be called when an app opens; typically in the didFinishLaunching event.
Works only once per app version, does not have any effect if called again in the same app version.
@param refId A reference id used to track an install and/or update, corresponds to advertiser_ref_id on the website.
*/
- (void)trackInstallWithReferenceId:(NSString *)refId;
/*!
Instead of an Install, force an Update to be recorded.
To be used if MAT sdk was not integrated in the previous
version of this app. Only use this method if your app can distinguish
between an install and an update, else use trackInstall.
To be called when an app opens; typically in the didFinishLaunching event.
Works only once per app version, does not have any effect if called again in the same app version.
*/
- (void)trackUpdate;
/*!
Instead of an Install, force an Update to be recorded.
To be used if MAT sdk was not integrated in the previous
version of this app. Only use this method if your app can distinguish
between an install and an update, else use trackInstallWithReferenceId.
To be called when an app opens; typically in the didFinishLaunching event.
Works only once per app version, does not have any effect if called again in the same app version.
@param refId A reference id used to track an update, corresponds to advertiser_ref_id on the website.
*/
- (void)trackUpdateWithReferenceId:(NSString *)refId;
#pragma mark - Track Actions
/** @name Track Actions */
/*!
Record a Track Action for an Event Id or Name.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId;
/*!
Record a Track Action for an Event Id or Name and reference id.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param refId The referencId for an event, corresponds to advertiser_ref_id on the website.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
referenceId:(NSString *)refId;
/*!
Record a Track Action for an Event Id or Name, revenue and currency.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param revenueAmount The revenue amount for the event.
@param currencyCode The currency code override for the event. Blank defaults to sdk setting.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
revenueAmount:(float)revenueAmount
currencyCode:(NSString *)currencyCode;
/*!
Record a Track Action for an Event Id or Name and reference id, revenue and currency.
@param eventIdOrName The event name or event id.
@param isId Yes if eventIdOrName is the event id for a pre-defined event on the MAT website, NO otherwise
@param refId The referencId for an event, corresponds to advertiser_ref_id on the website.
@param revenueAmount The revenue amount for the event.
@param currencyCode The currency code override for the event. Blank defaults to sdk setting.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
referenceId:(NSString *)refId
revenueAmount:(float)revenueAmount
currencyCode:(NSString *)currencyCode;
#pragma mark - Track Actions With Event Items
/** @name Track Actions With Event Items */
/*!
Record a Track Action for an Event Id or Name and a list of event items.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param eventItems An array of MATEventItem objects
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
eventItems:(NSArray *)eventItems;
/*!
Record a Track Action for an Event Name or Id.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param eventItems An array of MATEventItem objects
@param refId The referencId for an event, corresponds to advertiser_ref_id on the website.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
eventItems:(NSArray *)eventItems
referenceId:(NSString *)refId;
/*!
Record a Track Action for an Event Name or Id.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param eventItems An array of MATEventItem objects
@param revenueAmount The revenue amount for the event.
@param currencyCode The currency code override for the event. Blank defaults to sdk setting.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
eventItems:(NSArray *)eventItems
revenueAmount:(float)revenueAmount
currencyCode:(NSString *)currencyCode;
/*!
Record a Track Action for an Event Name or Id.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param eventItems An array of MATEventItem objects
@param refId The referencId for an event, corresponds to advertiser_ref_id on the website.
@param revenueAmount The revenue amount for the event.
@param currencyCode The currency code override for the event. Blank defaults to sdk setting.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
eventItems:(NSArray *)eventItems
referenceId:(NSString *)refId
revenueAmount:(float)revenueAmount
currencyCode:(NSString *)currencyCode;
/*!
Record a Track Action for an Event Name or Id.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param eventItems An array of MATEventItem objects
@param refId The referencId for an event, corresponds to advertiser_ref_id on the website.
@param revenueAmount The revenue amount for the event.
@param currencyCode The currency code override for the event. Blank defaults to sdk setting.
@param transactionState The in-app purchase transaction SKPaymentTransactionState as received from the iTunes store.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
eventItems:(NSArray *)eventItems
referenceId:(NSString *)refId
revenueAmount:(float)revenueAmount
currencyCode:(NSString *)currencyCode
transactionState:(NSInteger)transactionState;
/*!
Record a Track Action for an Event Name or Id.
@param eventIdOrName The event name or event id.
@param isId Yes if the event is an Id otherwise No if the event is a name only.
@param eventItems An array of MATEventItem objects
@param refId The referencId for an event, corresponds to advertiser_ref_id on the website.
@param revenueAmount The revenue amount for the event.
@param currencyCode The currency code override for the event. Blank defaults to sdk setting.
@param transactionState The in-app purchase transaction SKPaymentTransactionState as received from the iTunes store.
@param receipt The in-app purchase transaction receipt as received from the iTunes store.
*/
- (void)trackActionForEventIdOrName:(NSString *)eventIdOrName
eventIsId:(BOOL)isId
eventItems:(NSArray *)eventItems
referenceId:(NSString *)refId
revenueAmount:(float)revenueAmount
currencyCode:(NSString *)currencyCode
transactionState:(NSInteger)transactionState
receipt:(NSData *)receipt;
#pragma mark - Cookie Tracking
/** @name Cookie Tracking */
/*!
Sets whether or not to user cookie based tracking.
Default: NO
@param yesorno YES/NO for cookie based tracking.
*/
- (void)setUseCookieTracking:(BOOL)yesorno;
#pragma mark - App-to-app Tracking
/** @name App-To-App Tracking */
/*!
Sets a url to be used with app-to-app tracking so that
the sdk can open the download (redirect) url. This is
used in conjunction with the setTracking:advertiserId:offerId:publisherId:redirect: method.
@param redirect_url The string name for the url.
*/
- (void)setRedirectUrl:(NSString *)redirectURL;
/*!
Start a Tracking Session on the MAT server.
@param targetAppPackageName The bundle identifier of the target app.
@param targetAppAdvertiserId The MAT advertiser id of the target app.
@param offerId The MAT offer id of the target app.
@param publisherId The MAT publisher id of the target app.
@param shouldRedirect Should redirect to the download url if the tracking session was successfully created. See setRedirectUrl:.
*/
- (void)setTracking:(NSString *)targetAppPackageName
advertiserId:(NSString *)targetAppAdvertiserId
offerId:(NSString *)targetAdvertiserOfferId
publisherId:(NSString *)targetAdvertiserPublisherId
redirect:(BOOL)shouldRedirect;
#pragma mark - Re-Engagement Method
/** @name Application Re-Engagement */
/*!
Record the URL and Source when an application is opened via a URL scheme.
This typically occurs during OAUTH or when an app exits and is returned
to via a URL. The data will be sent to the HasOffers server so that a
Re-Engagement can be recorded.
@param urlString the url string used to open your app.
@param sourceApplication the source used to open your app. For example, mobile safari.
*/
- (void)applicationDidOpenURL:(NSString *)urlString sourceApplication:(NSString *)sourceApplication;
@end
#pragma mark - MobileAppTrackerDelegate
/** @name MobileAppTrackerDelegate */
/*!
Protocol that allows for callbacks from the MobileAppTracker methods.
To use, set your class as the delegate for MAT and implement these methods.
*/
@protocol MobileAppTrackerDelegate <NSObject>
@optional
/*!
Delegate method called when a track action succeeds.
@param tracker The MobileAppTracker instance.
@param data The success data returned by the MobileAppTracker.
*/
- (void)mobileAppTracker:(MobileAppTracker *)tracker didSucceedWithData:(NSData *)data;
/*!
Delegate method called when a track action fails.
@param tracker The MobileAppTracker instance.
@param error Error object returned by the MobileAppTracker.
*/
- (void)mobileAppTracker:(MobileAppTracker *)tracker didFailWithError:(NSError *)error;
/*!
Delegate method called when an iAd is displayed and its parent view is faded in.
*/
- (void) mobileAppTrackerDidDisplayiAd;
/*!
Delegate method called when an iAd failed to display and its parent view is faded out.
*/
- (void) mobileAppTrackerDidRemoveiAd;
/*!
Delegate method called to pass through an iAd display error.
@param error Error object returned by the iAd framework.
*/
- (void) mobileAppTrackerFailedToReceiveiAdWithError:(NSError *)error;
@end
#pragma mark - MATEventItem
/*!
MATEventItem represents event items for use with MAT events.
*/
@interface MATEventItem : NSObject
/** @name MATEventItem Properties */
/*!
name of the event item
*/
@property (nonatomic, copy) NSString *item;
/*!
unit price of the event item
*/
@property (nonatomic, assign) float unitPrice;
/*!
quantity of the event item
*/
@property (nonatomic, assign) int quantity;
/*!
revenue of the event item
*/
@property (nonatomic, assign) float revenue;
/*!
an extra parameter that corresponds to attribute_sub1 property of the event item
*/
@property (nonatomic, copy) NSString *attribute1;
/*!
an extra parameter that corresponds to attribute_sub2 property of the event item
*/
@property (nonatomic, copy) NSString *attribute2;
/*!
an extra parameter that corresponds to attribute_sub3 property of the event item
*/
@property (nonatomic, copy) NSString *attribute3;
/*!
an extra parameter that corresponds to attribute_sub4 property of the event item
*/
@property (nonatomic, copy) NSString *attribute4;
/*!
an extra parameter that corresponds to attribute_sub5 property of the event item
*/
@property (nonatomic, copy) NSString *attribute5;
/** @name Methods to create MATEventItem objects.*/
/*!
Method to create an event item. Revenue will be calculated using (quantity * unitPrice).
@param name name of the event item
@param unitPrice unit price of the event item
@param quantity quantity of the event item
*/
+ (MATEventItem *)eventItemWithName:(NSString *)name unitPrice:(float)unitPrice quantity:(int)quantity;
/*!
Method to create an event item.
@param name name of the event item
@param unitPrice unit price of the event item
@param quantity quantity of the event item
@param revenue revenue of the event item, to be used instead of (quantity * unitPrice)
*/
+ (MATEventItem *)eventItemWithName:(NSString *)name unitPrice:(float)unitPrice quantity:(int)quantity revenue:(float)revenue;
/*!
Method to create an event item.
@param name name of the event item
@param attribute1 an extra parameter that corresponds to attribute_sub1 property of the event item
@param attribute2 an extra parameter that corresponds to attribute_sub2 property of the event item
@param attribute3 an extra parameter that corresponds to attribute_sub3 property of the event item
@param attribute4 an extra parameter that corresponds to attribute_sub4 property of the event item
@param attribute5 an extra parameter that corresponds to attribute_sub5 property of the event item
*/
+ (MATEventItem *)eventItemWithName:(NSString *)name
attribute1:(NSString *)attribute1
attribute2:(NSString *)attribute2
attribute3:(NSString *)attribute3
attribute4:(NSString *)attribute4
attribute5:(NSString *)attribute5;
/*!
Method to create an event item.
@param name name of the event item
@param unitPrice unit price of the event item
@param quantity quantity of the event item
@param revenue revenue of the event item, to be used instead of (quantity * unitPrice)
@param attribute1 an extra parameter that corresponds to attribute_sub1 property of the event item
@param attribute2 an extra parameter that corresponds to attribute_sub2 property of the event item
@param attribute3 an extra parameter that corresponds to attribute_sub3 property of the event item
@param attribute4 an extra parameter that corresponds to attribute_sub4 property of the event item
@param attribute5 an extra parameter that corresponds to attribute_sub5 property of the event item
*/
+ (MATEventItem *)eventItemWithName:(NSString *)name unitPrice:(float)unitPrice quantity:(int)quantity revenue:(float)revenue
attribute1:(NSString *)attribute1
attribute2:(NSString *)attribute2
attribute3:(NSString *)attribute3
attribute4:(NSString *)attribute4
attribute5:(NSString *)attribute5;
@end