iOS SDK  12.0.0
 All Classes Functions Enumerations Enumerator Groups Pages
Flurry Class Reference

Provides all available methods for defining and reporting Analytics from use of your app. More...

#import <Flurry.h>

Inherits NSObject.

Class Methods

(void) + setDelegate:
 Set Flurry delegate for callback on session creation. More...
 
(void) + setDelegate:withCallbackQueue:
 Set Flurry delegate for callback on session creation with a callback queue. More...
 
(BOOL) + activeSessionExists
 Returns true if a session currently exists and is active. More...
 
(nonnull NSString *) + getSessionID
 Returns the session ID of the current active session. More...
 
(void) + pauseBackgroundSession
 Pauses a Flurry session left running in background. More...
 
(void) + openPrivacyDashboard:
 Open privacy dashboard in Safari Browser async with a completion handler callback. More...
 
(void) + setAppVersion:
 Explicitly specifies the App Version that Flurry will use to group Analytics data. More...
 
(void) + setSessionContinueSeconds:
 Set the timeout for expiring a Flurry session. More...
 
(void) + setCountBackgroundSessions:
 Enables opting out of background sessions being counted towards total sessions. More...
 
(BOOL) + isInitialized
 indicates whether a Flurry session has been initialized More...
 
(FlurryEventRecordStatus) + logStandardEvent:withParameters:
 Records a standard parameterized event specified by eventType with parameters. More...
 
Pre-Session Calls

Optional sdk settings that should be called before start session.

(nonnull NSString *) + getFlurryAgentVersion
 Retrieves the Flurry Agent Build Version. More...
 
(void) + setShowErrorInLogEnabled:
 Displays an exception in the debug log if thrown during a Session. More...
 
(void) + setLogLevel:
 Generates debug logs to console. More...
 
startSession APIs'

API to start session by passing API key, optionally passing launchOptions and/or customizing the session settings/options Only one of the API must be called to start the session

(void) + startSession:
 Start a Flurry session for the project denoted by apiKey. More...
 
(void) + startSession:withOptions:
 Start a Flurry session for the project denoted by apiKey. Gather more information by passing in the launchOptions. More...
 
(void) + startSession:withOptions:withSessionBuilder:
 Start a Flurry session for the project denoted by apiKey by specifying the desired session construction options. Gather more information by passing in the launchOptions. More...
 
(void) + startSession:withSessionBuilder:
 Start a Flurry session for the project denoted by apiKey by specifying the desired session construction options. More...
 
User Info

Methods to set user information.

(void) + setUserID:
 Assign a unique id for a user in your app. More...
 
(void) + setAge:
 Set your user's age in years. More...
 
(void) + setGender:
 Set your user's gender. More...
 
Location Reporting

Opt-out Methods for setting location information.

(BOOL) + trackPreciseLocation:
 Turn on/off location information of the session (default is on). More...
 
(void) + setIAPReportingEnabled:
 Enables implicit recording of Apple Store transactions. More...
 
(void) + addSessionOrigin:
 Adds an session origin attached to each session specified by sessionOriginName. More...
 
(void) + addSessionOrigin:withDeepLink:
 Adds an session origin and deep link attached to each session specified by sessionOriginName and deepLink. More...
 
(void) + sessionProperties:
 Adds a custom parameterized session parameters parameters. More...
 
(void) + addOrigin:withVersion:
 Adds an SDK origin specified by originName and originVersion. More...
 
(void) + addOrigin:withVersion:withParameters:
 Adds a custom parameterized origin specified by originName with originVersion and parameters. More...
 
Event and Error Logging

Methods for reporting custom events and errors during the session.

(FlurryEventRecordStatus) + logEvent:
 Records a custom event specified by eventName. More...
 
(FlurryEventRecordStatus) + logEvent:withParameters:
 Records a custom parameterized event specified by eventName with parameters. More...
 
(FlurryEventRecordStatus) + logEvent:syndicationID:parameters:
 Records a syndicated event specified by syndicationEvent. More...
 
(void) + logPaymentTransaction:statusCallback:
 Records an Apple Store transaction. More...
 
(void) + logPaymentTransactionWithTransactionId:productId:quantity:price:currency:productName:transactionState:userDefinedParams:statusCallback:
 Records Apple store IAP transaction params and user defined transaction params manually. More...
 
(FlurryEventRecordStatus) + logEvent:timed:
 Records a timed event specified by eventName. More...
 
(FlurryEventRecordStatus) + logEvent:withParameters:timed:
 Records a custom parameterized timed event specified by eventName with parameters. More...
 
(void) + endTimedEvent:withParameters:
 Ends a timed event specified by eventName and optionally updates parameters with parameters. More...
 
(void) + logError:message:exception:
 Records an app exception. Commonly used to catch unhandled exceptions. More...
 
(void) + logError:message:exception:withParameters:
 Records an app exception. Commonly used to catch unhandled exceptions. More...
 
(void) + logError:message:error:
 Records an app error for reporting to Flurry. More...
 
(void) + logError:message:error:withParameters:
 Records an app error. More...
 
(void) + leaveBreadcrumb:
 Leave a breadcrumb. More...
 

Detailed Description

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 Flurry.h. For information on how to use Flurry's Ads SDK to attract high-quality users and monetize your user base see Support Center - Publishers.
Version
4.3.0

Definition at line 137 of file Flurry.h.

Method Documentation

+ (BOOL) activeSessionExists

Returns true if a session currently exists and is active.

Since
6.0.0
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
// ....
}
+ (void) addOrigin: (nonnull NSString *)  originName

Adds an SDK origin specified by originName and 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 Also
+ addOrigin:withVersion:withParameters: for details on reporting origin info with parameters.
- (void)interestingSDKWrapperLibraryfunction
{
// ... after calling startSession
[Flurry addOrigin:@"Interesting_Wrapper" withVersion:@"1.0.0"];
// more code ...
}
Parameters
originNameName of the origin.
originVersionVersion string of the origin wrapper
+ (void) addOrigin: (nonnull NSString *)  originName
withVersion: (nonnull NSString *)  originVersion 

Adds a custom parameterized origin specified by originName with originVersion and parameters.

Since
5.0.0

This method overloads #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.
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.
- (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" withParameters:params];
// more code ...
}
Parameters
originNameName of the origin.
originVersionVersion string of the origin wrapper
parametersAn immutable copy of map containing Name-Value pairs of parameters.
+ (void) addSessionOrigin:

Adds an session origin attached to each session specified by sessionOriginName.

Since
6.5.0

This method allows you to specify session origin for each session. This is different than addOrigin:withVersion: (originAttributes) which is used for third party wrappers after every session start.

- (void)interestingMethod
{
// ... after calling startSession
[Flurry addSessionOrigin:@"facebuk"];
// more code ...
}
Parameters
sessionOriginNameName of the origin.
+ (void) addSessionOrigin: (nonnull NSString *)  sessionOriginName

Adds an session origin and deep link attached to each session specified by sessionOriginName and deepLink.

Since
6.5.0

This method allows you to specify session origin and deep link for each session. This is different than addOrigin:withVersion: (originAttributes) which is used for third party wrappers after every session start.

- (void)interestingMethod
{
// ... after calling startSession
[Flurry addSessionOrigin:@"facebuk" withDeepLink:@"https://www.facebuk.com/xyz/"];
// more code ...
}
Parameters
sessionOriginNameName of the origin.
deepLinkUrl of the deep Link.
+ (void) endTimedEvent: (nonnull NSString *)  eventName

Ends a timed event specified by eventName and optionally updates parameters with 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.
If the app is backgrounded prior to ending a timed event, the Flurry SDK will automatically end the timer on the event.
endTimedEvent:withParameters: is ignored if called on a previously terminated event.
See Also
+ logEvent:withParameters:timed: for details on starting a timed event with parameters.
- (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
}
Parameters
eventNameName 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.
parametersAn immutable copy of map containing Name-Value pairs of parameters.
+ (nonnull NSString *) getFlurryAgentVersion

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 Flurry Support

See Also
+ setLogLevel: for information on how to view debugging information on your console.
Returns
The agent version of the Flurry SDK.
+ (nonnull NSString*) getSessionID

Returns the session ID of the current active session.

Since
6.3.0
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
// ....
}
+ (BOOL) isInitialized

indicates whether a Flurry session has been initialized

Since
12.0.0
Returns
YES if a Flurry session has been initialized and is actively running
+ (void) leaveBreadcrumb: (nonnull NSString *)  breadcrumb

Leave a breadcrumb.

Since
8.4.0 This method captures breadcrumbs of 250 characters. The last 207 recorded breadcrumbs are included in crash and error logs. Breadcrumbs are reset at every application launch.
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error;
{
[Flurry leaveBreadcrumb:@"WebView not loading"];
}
Parameters
breadcrumbstring.
+ (void) logError: (nonnull NSString *)  errorID
message: (nullable NSString *)  message 

Records an app error for reporting to Flurry.

Since
2.7
See Also
+ logError:message:exception: for details on capturing Exceptions.
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error;
{
[Flurry logError:@"WebView No Load" message:[error localizedDescription] error:error];
}
Parameters
errorIDName of the error.
messageThe message to associate with the error.
errorThe error object to report.
+ (void) logError: (nonnull NSString *)  errorID
message: (nullable NSString *)  message
error: (nullable NSError *)  error 

Records an app error.

Since
8.4.0 This method overloads on logError:message:error: to capture an error for reporting to Flurry.
See Also
+ logError:message:exception:withParameters: for details on capturing Exceptions.
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error;
{
[Flurry logError:@"WebView No Load" message:[error localizedDescription] error:error];
}
Parameters
errorIDName of the error.
messageThe message to associate with the error.
errorThe error object to report.
parametersCustom parameters associated with the error
+ (void) logError: (nonnull NSString *)  errorID
message: (nullable NSString *)  message 

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 Also
+ logError:message:error: for details on capturing errors.
- (void) uncaughtExceptionHandler(NSException *exception)
{
[Flurry logError:@"Uncaught" message:@"Crash!" exception:exception];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
[Flurry startSession:@"YOUR_API_KEY"];
// ....
}
Parameters
errorIDName of the error.
messageThe message to associate with the error.
exceptionThe exception object to report.
+ (void) logError: (nonnull NSString *)  errorID
message: (nullable NSString *)  message
exception: (nullable NSException *)  exception 

Records an app exception. Commonly used to catch unhandled exceptions.

Since
8.4.0

This method overloads on logError:message:exception: to capture an exception with parameters 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 Also
+ logError:message:error:withParameters: for details on capturing errors.
- (void) uncaughtExceptionHandler(NSException *exception)
{
NSDictionary* crashParameters = [NSDictionary dictionaryWithObjectsAndKeys:@"AppVersion", @"3.2", nil];
[Flurry logError:@"Uncaught" message:@"Crash!" exception:exception withParameters:crashParameters];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
[Flurry startSession:@"YOUR_API_KEY"];
// ....
}
Parameters
errorIDName of the error.
messageThe message to associate with the error.
exceptionThe exception object to report.
parametersCustom parameters associated with the exception
+ (FlurryEventRecordStatus) logEvent:

Records a custom event specified by 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.
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 Also
+ logEvent:withParameters: for details on storing events with parameters.
+ logEvent:timed: for details on storing timed events.
+ logEvent:withParameters:timed: for details on storing timed events with parameters.
+ endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating parameters.
- (void)interestingAppAction
{
[Flurry logEvent:@"Interesting_Action"];
// Perform interesting action
}
Parameters
eventNameName 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.
Returns
enum FlurryEventRecordStatus for the recording status of the logged event.
+ (FlurryEventRecordStatus) logEvent: (FlurrySyndicationEvent)  syndicationEvent
syndicationID: (nonnull NSString *)  syndicationID 

Records a syndicated event specified by syndicationEvent.

Since
6.7.0

This method is excusively for use by the Tumblr App, calls from others app will be ignored.

- (void) reblogButtonHandler
{
[Flurry logEvent:Reblog syndicationID:@"123", parameters:nil];
// Perform
}
Parameters
syndicationEventsyndication event.
syndicationIDsyndication ID that is associated with the event
parametersuse this to pass in syndication parameters such as kSyndicationiOSDeepLink, kSyndicationAndroidDeepLink, kSyndicationWebLinkDeepLink
Returns
enum FlurryEventRecordStatus for the recording status of the logged event.
+ (FlurryEventRecordStatus) logEvent: (nonnull NSString *)  eventName

Records a timed event specified by eventName.

Since
2.8.4

This method overloads #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.
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 Also
+ logEvent:withParameters:timed: for details on storing timed events with parameters.
+ endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating parameters.
- (void)startLevel
{
[Flurry logEvent:@"Level Played" timed:YES];
// Start user on level
}
- (void)endLevel
{
[Flurry endTimedEvent:@"Level Played" withParameters:nil];
// User done with level
}
Parameters
eventNameName 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.
timedSpecifies the event will be timed..
Returns
enum FlurryEventRecordStatus for the recording status of the logged event.
+ (FlurryEventRecordStatus) logEvent: (nonnull NSString *)  eventName

Records a custom parameterized event specified by eventName with parameters.

Since
2.8.4

This method overloads #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 Flurrly Dev Portal.

Note
You should not pass private or confidential information about your users in a custom event.
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.
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 Also
+ logEvent:withParameters:timed: for details on storing timed events with parameters.
+ endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating parameters.
- (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
}
Parameters
eventNameName 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.
parametersAn immutable copy of map containing Name-Value pairs of parameters.
Returns
enum FlurryEventRecordStatus for the recording status of the logged event.
+ (FlurryEventRecordStatus) logEvent: (nonnull NSString *)  eventName
withParameters: (nullable NSDictionary *)  parameters 

Records a custom parameterized timed event specified by eventName with parameters.

Since
2.8.4

This method overloads #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 Also
+ endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating parameters.
- (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
}
Parameters
eventNameName 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.
parametersAn immutable copy of map containing Name-Value pairs of parameters.
timedSpecifies the event will be timed..
Returns
enum FlurryEventRecordStatus for the recording status of the logged event.
+ (void) logPaymentTransaction: (nonnull SKPaymentTransaction *)  transaction

Records an Apple Store transaction.

Since
7.8.0

This method needs to be called before a transaction is finished and finalized.

Note
: Needs a 'required' dependency on StoreKit for this API to function correctly.
Parameters
transactionan SKPaymentTransaction.
statusCallbacka callback gettign called when the status of ID that is associated with the event
+ (void) logPaymentTransactionWithTransactionId: (nonnull NSString *)  transactionId
productId: (nonnull NSString *)  productId
quantity: (NSUInteger)  quantity
price: (double)  price
currency: (nonnull NSString *)  currency
productName: (nonnull NSString *)  productName
transactionState: (FlurryPaymentTransactionState)  transactionState
userDefinedParams: (nullable NSDictionary *)  transactionParams 

Records Apple store IAP transaction params and user defined transaction params manually.

Since
12.0.0
Parameters
transactionIda string Id for this IAP transaction
productIda string Id for this IAP transaction product
quantityan integer representation of quantity of items purchased
pricea float representation of price of the item
currencya string representation of currency of the transaction
productNamea string representation of product name
transactionStatean enum to convert transaction state to integer: 0:Purchasing, 1:Success, 2:Failure, 3:Restored, 4:Deferred
transactionParamsa dictionary of user defined transaction params to record
statusCallbacka callback gettign called when the status of ID that is associated with the event
+ (FlurryEventRecordStatus) logStandardEvent: (FlurryEvent)  eventType

Records a standard parameterized event specified by eventType with parameters.

Since
11.3.0

This method allows you to log standard events associated with parameters. Parameters are extremely valuable as they allow you to store characteristics of an action. For example, if a user purchased an item (log an purchase event), it may be helpful to know item info (itemName, itemType, itemId, itemCount), and transaction info (price, totalAmount, currency, transactionId) of such events.

Note
You should not pass private or confidential information about your users in a standard event.

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.

- (void)someGamingEvent{
FlurryParamBuilder *param = [[[[[[FlurryParamBuilder alloc] init]
setString:@"Game pro" forParam:[FlurryParamBuilder levelName]]
setInteger:2 forParam:[FlurryParamBuilder levelNumber]]
setString:@"12345" forKey:@"userId"]
setInteger:10 forKey:@"numOfTrials"];
[Flurry logStandardEvent:FLURRY_EVENT_LEVEL_COMPLETED withParameters:param];
}
Parameters
eventTypeFlurryEvent enum.
parametersa FlurryParam object that stores key-value pairs of a standard parameterized event.
Returns
enum FlurryEventRecordStatus for the recording status of the logged event.

Provided by category Flurry(Event).

+ (void) openPrivacyDashboard: (BOOL success)  completionHandler

Open privacy dashboard in Safari Browser async with a completion handler callback.

Since
8.5.0

This method is used to open a web page of privacy dashboard in external browser for user to access and edit their data under the scope of GDPR, in the callback, you are able to check whether privacy dashboard is successfully opened, and apply fallback logics.

Note
: Call this method after invoking startSession:
Parameters
completionHandlera callback getting called when SDK finishes the attempt to openURL the privacy dashboard, the success boolean provided for checks and fallbacks.
+ (void) pauseBackgroundSession

Pauses a Flurry session left running in background.

Since
4.2.2

This method can be called when application finished all background tasks (such as playing music) to pause session.

- (void)allBackgroundTasksFinished
{
// ....
// ....
}
+ (void) sessionProperties: (nonnull NSDictionary *)  parameters

Adds a custom parameterized session parameters parameters.

Since
6.5.0

This method allows you to associate parameters with a session. Parameters are valuable as they allow you to store characteristics of a session.

Note
You should not pass private or confidential information about your origin info in a custom origin.
A maximum of 10 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.
- (void)interestingMethod
{
// ... after calling startSession
NSDictionary *params =
[NSDictionary dictionaryWithObjectsAndKeys:@"Session Info Item", // Parameter Value
@"Session Info Item Key", // Parameter Name
nil];
[Flurry sessionProperties:params];
// more code ...
}
Parameters
parametersAn immutable copy of map containing Name-Value pairs of parameters.
+ (void) setAge:

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.
Parameters
ageReported age of user.
+ (void) setAppVersion:

Explicitly specifies the App Version that Flurry will use to group Analytics data.

Since
12.0.0

This is a 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.
Parameters
versionThe custom version name.
+ (void) setCountBackgroundSessions:

Enables opting out of background sessions being counted towards total sessions.

Since
12.0.0
Parameters
valueNO to opt out of counting background sessions towards total sessions. The default value for the session is YES
+ (void) setDelegate:

Set Flurry delegate for callback on session creation.

Since
6.3.0
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
// If self implements protocol, FlurryDelegate
[Flurry setDelegate:self];
// ....
}
+ (void) setDelegate: (nonnull id< FlurryDelegate >)  delegate

Set Flurry delegate for callback on session creation with a callback queue.

Since
8.4.4
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
// If self implements protocol, FlurryDelegate
[Flurry setDelegate:self withCallbackQueue:queue];
// ....
}
+ (void) setGender:

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 "m" or @c @"f"

Note
The gender is aggregated across all users of your app and not available on a per user basis.
Parameters
genderReported gender of user.
+ (void) setIAPReportingEnabled:

Enables implicit recording of Apple Store transactions.

Since
7.9.0

This method needs to be called before any transaction is finialized.

Note
: Needs a 'required' dependency on StoreKit for this API to function correctly.
Parameters
valueYES to enable transaction logging, NO to stop transaction logging.
+ (void) setLogLevel:

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 FlurryLogLevelCriticalOnly.

Note
The log level can be changed at any point in the execution of your application and the level that is set will take effect for SDK activity after this call.
Parameters
valueLog level
+ (void) setSessionContinueSeconds:

Set the timeout for expiring a Flurry session.

Since
12.0.0

This is a 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.

Parameters
secondsThe time in seconds to set the session timeout to.
+ (void) setShowErrorInLogEnabled:

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 NO.

Note
This method can be called at any point in the execution of your application and the setting will take effect for SDK activity after this call.
See Also
+ setLogLevel: for information on how to view debugging information on your console.
+ logError:message:exception: for details on logging Exceptions.
+ logError:message:error: for details on logging errors.
Parameters
valueYES to show errors in debug logs, NO to omit errors in debug logs.
+ (void) setUserID:

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.
Parameters
userIDThe app id for a user.
+ (void) startSession:

Start a Flurry session for the project denoted by apiKey.

Since
2.6

This method serves as the entry point to Flurry Analytics collection. It must be called in the scope of applicationDidFinishLaunching. The session will continue for the period the app is in the foreground until your app is backgrounded for the time specified in #withSessionContinueSeconds:. 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 #withCrashReporting: in FlurrySessionBuilder 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 Also
#withSessionContinueSeconds: for details on setting a custom session timeout in FlurrySessionBuilder.
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// Optional Flurry startup methods
[Flurry startSession:@"YOUR_API_KEY"];
// ....
}
Parameters
apiKeyThe API key for this project.
+ (void) startSession: (nonnull NSString *)  apiKey

Start a Flurry session for the project denoted by apiKey. Gather more information by passing in the launchOptions.

Since
4.0.8

This method overloads on the startSession: and serves as the entry point to Flurry Analytics collection. It must be called in the scope of 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 #withSessionContinueSeconds:. 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 #withCrashReporting: in FlurrySessionBuilder 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 Also
#withSessionContinueSeconds: for details on setting a custom session timeout in FlurrySessionBuilder.
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
[Flurry startSession:@"YOUR_API_KEY" withOptions:launchOptions];
// ....
}
Parameters
apiKeyThe API key for this project.
optionspassed launchOptions from the applicatin's didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+ (void) startSession: (nonnull NSString *)  apiKey
withOptions: (nullable id)  options 

Start a Flurry session for the project denoted by apiKey by specifying the desired session construction options. Gather more information by passing in the launchOptions.

Since
7.7.0

This method overloads on the startSession:withOptions: and serves as the entry point to Flurry Analytics collection. It must be called in the scope of 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 #withSessionContinueSeconds:. 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 Also
#withSessionContinueSeconds: for details on setting a custom session timeout in FlurrySessionBuilder.
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
FlurrySessionBuilder* builder = [[[[[FlurrySessionBuilder new] withLogLevel:FlurryLogLevelDebug]
withCrashReporting:NO]
withSessionContinueSeconds:10]
withAppVersion:@"0.1.2"];
[Flurry startSession:@"YOUR_API_KEY" withOptions:launchOptions withSessionBuilder:sessionBuilder];
// ....
}
Parameters
apiKeyThe API key for this project.
optionspassed launchOptions from the applicatin's didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
sessionBuilderpass in the session builder object to specify that session construction options
+ (void) startSession: (nonnull NSString *)  apiKey

Start a Flurry session for the project denoted by apiKey by specifying the desired session construction options.

Since
7.7.0

This method overloads on the startSession: and serves as the entry point to Flurry Analytics collection. It must be called in the scope of applicationDidFinishLaunching. The session will continue for the period the app is in the foreground until your app is backgrounded for the time specified in #withSessionContinueSeconds:. 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 Also
#withSessionContinueSeconds: for details on setting a custom session timeout in FlurrySessionBuilder.
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Optional Flurry startup methods
FlurrySessionBuilder* builder = [[[[[FlurrySessionBuilder new] withLogLevel:FlurryLogLevelDebug]
withCrashReporting:NO]
withSessionContinueSeconds:10]
withAppVersion:@"0.1.2"];
[Flurry startSession:@"YOUR_API_KEY" withSessionBuilder:sessionBuilder];
// ....
}
Parameters
apiKeyThe API key for this project.
sessionBuilderpass in the session builder object to specify that session construction options
+ (BOOL) trackPreciseLocation: (BOOL)  state

Turn on/off location information of the session (default is on).

Since
8.4.0

Use CLLocationManager to start the location tracking of the session. Flurry does not prompt users for location permission, we fetch the available location in device daemon.

Note
Only the last location in cache is captured per session.
Regardless of accuracy specified, the Flurry SDK will only report location at city level or higher.
Location is aggregated across all users of your app and not available on a per user basis.
This information should only be captured if it is germaine to the use of your app.
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
[locationManager startUpdatingLocation];

It is on by default. After starting the location manager, you can turn off opt-out location tracking by calling this method.

[Flurry trackPreciseLocation:NO];
Parameters
stateThe boolean to switch on/off for location tracking
Returns
a boolean, if the state is YES, it tests device/app permission. If permission is granted, it returns NO. If permission is valid, it returns YES. If the state is NO, it always returns NO.

The documentation for this class was generated from the following file: