Splunk MINT SDK for iOS  5.1
 All Classes Files Functions Variables Properties Macros
Mint Class Reference

#import <Mint.h>

Inherits NSObject.

Instance Methods

(BOOL) - isInitialized
 
(BOOL) - isSessionActive
 
(void) - enableDebugLog:
 
(void) - disableCrashReporter
 
(void) - flush
 
(void) - initAndStartSessionWithAPIKey:
 
(void) - initAndStartSessionWithHECUrl:token:
 
(void) - leaveBreadcrumb:
 
(void) - clearBreadcrumbs
 
(void) - startSession
 
(void) - closeSession
 
(void) - logException:
 
(void) - logException:extraDataKey:extraDataValue:
 
(void) - logException:extraData:
 
(void) - disableNetworkMonitoring
 
(NSDictionary *) - getDevSettings
 
(void) - enableMintLoggingCache:
 
(void) - enableLogging:
 
(void) - enableFlushOnlyOverWiFi:
 
(void) - setLogging:
 
(NSString *) - transactionStart:
 
(NSString *) - transactionStart:extraDataKey:extraDataValue:
 
(NSString *) - transactionStart:extraData:
 
(void) - transactionStop:
 
(void) - transactionStop:extraDataKey:extraDataValue:
 
(void) - transactionStop:extraData:
 
(void) - transactionCancel:reason:
 
(void) - transactionCancel:reason:extraDataKey:extraDataValue:
 
(void) - transactionCancel:reason:extraData:
 
(void) - addURLToBlackList:
 
(NSMutableArray *) - blacklistUrls
 
(void) - logEventWithName:
 
(void) - logEventWithName:logLevel:
 
(void) - logEventWithName:logLevel:extraDataKey:extraDataValue:
 
(void) - logEventWithName:logLevel:extraData:
 
(void) - enableUserOptOut:
 
(NSString *) - getMintUUID
 
(NSString *) - getSessionID
 
(void) - logViewWithCurrentViewName:
 
(void) - logViewWithCurrentViewName:extraDataKey:extraDataValue:
 
(void) - logViewWithCurrentViewName:extraData:
 
(void) - setSessionInterval:
 
(BOOL) - isHTTPEventCollectorEnabled
 
(void) - MintLog
 
(void) - addExtraData:forKey:
 
(void) - addExtraData:
 
(NSString *) - extraDataForKey:
 
(void) - removeExtraDataForKey:
 
(void) - removeAllExtraData
 
(NSDictionary *) - extraData
 
(NSString *) - startTimerWithName:
 
(void) - stopTimerWithId:
 
(void) - logMethodTrace:
 
(void) - logMemoryWarningWithClassName:
 

Class Methods

(Mint *) + sharedInstance
 

Properties

NSString * userIdentifier
 
NSString * applicationEnvironment
 

Detailed Description

The Mint class is the main class for all appropriate requests. The Mint class.

Method Documentation

- (void) addExtraData: (MintLimitedExtraData *)  extraDataDictionary

Adds extra data to the global extra data collection as a dictionary.

Parameters
extraDataDictionaryA MintLimitedExtraData instance containing extra data.
- (void) addExtraData: (NSString *)  value
forKey: (NSString *)  key 

Adds extra data to the global extra data collection as a key-value pair.

Parameters
valueThe extra data value.
keyThe extra data key.
- (void) addURLToBlackList: (NSString *)  url

Adds a URL to the network monitoring blacklist.

Parameters
urlThe URL to ignore. This can be a partial URL.
- (NSMutableArray*) blacklistUrls

The URLs blacklisted from network monitoring.

Returns
A modifiable array that contains the blacklisted URLs.
- (void) clearBreadcrumbs

Clears the global breadcrumb list.

- (void) closeSession

Closes the session. All requests and crash reporting will continue to work properly, but the session is no longer logically active.

- (void) disableCrashReporter

Disables the crash reporter.

- (void) disableNetworkMonitoring

Disables network monitoring. Call this method before calling initAndStartSessionWithAPIKey or initAndStartSessionWithHECUrl.

- (void) enableDebugLog: (BOOL)  enable

Indicates whether additional logging output should be generated from the SDK. The default is NO.

Parameters
enableYES to generate additional logging.
- (void) enableFlushOnlyOverWiFi: (BOOL)  enable

Indicates whether to only send data over a WiFi connection.

Parameters
enableYES to send data only over WiFi.
- (void) enableLogging: (BOOL)  enable

Indicates whether to attach device logs to the crash.

Parameters
enableYES to attach device logs.
- (void) enableMintLoggingCache: (BOOL)  enable

Indicates whether to enable logging. When YES, NSLog console messages are cached and sent with the exception.

Parameters
enableYES to enable logging.
- (void) enableUserOptOut: (BOOL)  userOptOut

Indicates whether to prevent MINT from saving or sending any data for the user.

Parameters
userOptOutYES to prevent MINT from saving or sending any data.
- (NSDictionary*) extraData

Gets the global extra data collection.

- (NSString*) extraDataForKey: (NSString *)  key

Gets the extra data that corresponds to a given key.

Parameters
keyThe key.
Returns
The value.
- (void) flush

Sends all cached requests to the server.

- (NSDictionary*) getDevSettings

Gets the developer's remote settings as key-value pairs.

Returns
A dictionary of key-value pairs.
- (NSString*) getMintUUID

Returns the MINT universally unique identifier (UUID), which uniquely identifies a specific user.

Returns
The UUID of the user.
- (NSString*) getSessionID

Returns the current session ID.

Returns
The session ID.
- (void) initAndStartSessionWithAPIKey: (NSString *)  apiKey

Initializes the SDK and starts a new session for the MINT Data Collector environment. This method sends a ping request and receives remote settings.

Parameters
apiKeyThe Splunk MINT API key for the mobile app.
- (void) initAndStartSessionWithHECUrl: (NSString *)  url
token: (NSString *)  token 

Initializes the SDK and starts a new session the HTTP Event Collector (HEC) environment to send data over HTTP or HTTPS directly to Splunk Enterprise. This method validates the URL and sends a ping request.

Parameters
urlThe URL of the HEC MINT endpoint.
tokenThe HEC input token.
- (BOOL) isHTTPEventCollectorEnabled

Indicates whether the SDK has been initialized to send data over HTTP (or HTTPS) directly to Splunk Enterprise using the HTTP Event Collector.

- (BOOL) isInitialized

Indicates whether the plugin is initialized and operating properly.

- (BOOL) isSessionActive

Indicates whether there is an active session. You can close the current session and start a new one as needed.

- (void) leaveBreadcrumb: (NSString *)  crumb

Adds a breadcrumb description to the global breadcrumb list.

Parameters
crumbThe breadcrumb description.
- (void) logEventWithName: (NSString *)  name

Logs an event.

Parameters
nameThe name of the event (up to 256 characters).
- (void) logEventWithName: (NSString *)  name
logLevel: (MintLogLevel)  logLevel 

Logs an event with a log level.

Parameters
nameThe name of the event (up to 256 characters).
logLevelThe MintLogLevel enumeration value for the log level.
- (void) logEventWithName: (NSString *)  name
logLevel: (MintLogLevel)  logLevel
extraData: (MintLimitedExtraData *)  extraDataDictionary 

Logs an event with a log level and attaches extra data to the request.

Parameters
nameThe name of the event (up to 256 characters).
logLevelThe MintLogLevel enumeration value for the log level.
extraDataDictionaryA MintLimitedExtraData instance containing extra data.
- (void) logEventWithName: (NSString *)  name
logLevel: (MintLogLevel)  logLevel
extraDataKey: (NSString *)  key
extraDataValue: (NSString *)  value 

Logs an event with a log level and attaches extra data to the request.

Parameters
nameThe name of the event (up to 256 characters).
logLevelThe MintLogLevel enumeration value for the log level.
keyThe key for the additional extra data.
valueThe value of the additional extra data.
- (void) logException: (NSException *)  exception

Logs a handled exception in your try/catch block.

Parameters
exceptionThe NSException instance.
- (void) logException: (NSException *)  exception
extraData: (MintLimitedExtraData *)  extraDataDictionary 

Logs a handled exception in your try/catch block and attaches extra data to the request.

Parameters
exceptionThe NSException instance.
extraDataDictionaryA MintLimitedExtraData instance containing extra data.
- (void) logException: (NSException *)  exception
extraDataKey: (NSString *)  key
extraDataValue: (NSString *)  value 

Logs a handled exception in your try/catch block and attaches extra data to the request.

Parameters
exceptionThe NSException instance.
keyThe key for the extra data.
valueThe value of the extra data.
- (void) logMemoryWarningWithClassName: (NSString *)  className

Used internally by the SDK to log memory information when memory warnings are received.

Parameters
classNameThe name of the class that received a memory warning.
- (void) logMethodTrace: (NSDictionary *)  traceInfo

Used internally by the SDK to log trace information for methods.

Parameters
traceInfoThe trace information.
- (void) logViewWithCurrentViewName: (NSString *)  currentViewName

Logs a specific view as a Splunk data type.

Parameters
currentViewNameThe name of the current view.
- (void) logViewWithCurrentViewName: (NSString *)  currentViewName
extraData: (MintLimitedExtraData *)  extraDataDictionary 

Logs a specific view as a Splunk data type and attaches extra data to the request.

Parameters
currentViewNameThe name of the current view.
extraDataDictionaryA MintLimitedExtraData instance containing extra data.
- (void) logViewWithCurrentViewName: (NSString *)  currentViewName
extraDataKey: (NSString *)  key
extraDataValue: (NSString *)  value 

Logs a specific view as a Splunk data type and attaches extra data to the request.

Parameters
currentViewNameThe name of the current view.
keyThe key for the extra data.
valueThe value of the extra data.
- (void) MintLog (MintLogLevel)  logLevel
(NSString *)  message
  ... 

Sends the log entry to the console window, and caches a request to send to the server.

Parameters
logLevelThe MintLogLevel enumeration value for the log level.
messageThe message for the log level.
- (void) removeAllExtraData

Clears the global extra data collection.

- (void) removeExtraDataForKey: (NSString *)  key

Remove an entry from the global extra data collection for a given key.

Parameters
keyThe key of the extra data entry.
- (void) setLogging: (NSInteger)  linesCount

Sets the maximum number of lines to cache from the console log.

Parameters
linesCountThe number of lines.
- (void) setSessionInterval: (NSInteger)  intervalInSeconds

Configures the session interval.

Parameters
intervalInSecondsThe time interval for the session, in seconds.
+ (Mint*) sharedInstance

Returns the singleton Mint reference to use in your application. You should not initialize the Mint class yourself because unexpected results may occur.

Returns
The Mint singleton instance reference.
- (void) startSession

Starts a new session. If a previous session was initialized less than one minute earlier, this call is ignored.

- (NSString*) startTimerWithName: (NSString *)  timerName

Starts a timer.

Parameters
timerNameThe name of the timer.
Returns
The timer ID.
- (void) stopTimerWithId: (NSString *)  timerId

Stops a timer.

Parameters
timerIdThe timer ID.
- (void) transactionCancel: (NSString *)  transactionID
reason: (NSString *)  aReason 

Cancels a transaction.

Parameters
transactionIDThe ID of the transaction.
aReasonThe reason for cancelling the transaction.
- (void) transactionCancel: (NSString *)  transactionID
reason: (NSString *)  aReason
extraData: (MintLimitedExtraData *)  extraDataDictionary 

Cancels a transaction and attaches extra data to the request.

Parameters
transactionIDThe ID of the transaction.
aReasonThe reason for cancelling the transaction.
extraDataDictionaryA MintLimitedExtraData instance containing extra data.
- (void) transactionCancel: (NSString *)  transactionID
reason: (NSString *)  aReason
extraDataKey: (NSString *)  key
extraDataValue: (NSString *)  value 

Cancels a transaction and attaches extra data to the request.

Parameters
transactionIDThe ID of the transaction.
aReasonThe reason for cancelling the transaction.
keyThe key for the additional extra data.
valueThe value of the additional extra data.
- (NSString*) transactionStart: (NSString *)  transactionName

Starts a named transaction.

Parameters
transactionNameThe transaction name.
Returns
The transaction ID
- (NSString*) transactionStart: (NSString *)  transactionName
extraData: (MintLimitedExtraData *)  extraDataDictionary 

Starts a named transaction and attaches extra data to the request.

Parameters
transactionNameThe transaction name.
extraDataDictionaryA MintLimitedExtraData instance containing extra data.
Returns
The transaction ID
- (NSString*) transactionStart: (NSString *)  transactionName
extraDataKey: (NSString *)  key
extraDataValue: (NSString *)  value 

Starts a named transaction and attaches extra data to the request.

Parameters
transactionNameThe transaction name.
keyThe key for the extra data.
valueThe value of the extra data.
Returns
The transaction ID
- (void) transactionStop: (NSString *)  transactionID

Stops a transaction.

Parameters
transactionIDThe ID of the transaction.
- (void) transactionStop: (NSString *)  transactionID
extraData: (MintLimitedExtraData *)  extraDataDictionary 

Stops a transaction and attaches extra data to the request.

Parameters
transactionIDThe ID of the transaction.
extraDataDictionaryA MintLimitedExtraData instance containing extra data.
- (void) transactionStop: (NSString *)  transactionID
extraDataKey: (NSString *)  key
extraDataValue: (NSString *)  value 

Stops a transaction and attaches extra data to the request.

Parameters
transactionIDThe ID of the transaction.
keyThe key for the extra data.
valueThe value of the extra data.

Property Documentation

- (NSString*) applicationEnvironment
readwritenonatomicstrong

Sets an application environment. Use a custom string or one of the predefined enviroment constants:

  • SPLAppEnvRelease
  • SPLAppEnvStaging
  • SPLAppEnvUserAcceptanceTesting
  • SPLAppEnvTesting
  • SPLAppEnvDevelopment

If not explicitly set, the default is SPLAppEnvRelease.

- (NSString*) userIdentifier
readwritenonatomicstrong

A user identifier for the current user, such as a random ID, an email address, or a username.


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