Customize session handling
By default, Splunk MINT uses the initAndStartSessionWithAPIKey: and initAndStartSessionWithHECUrl: methods and the time zone of our servers to calculate the time a user's session begins. However, you can customize session handling if you need to.
- Note When you close a session, it does not impact any other feature of the Splunk MINT plugin. The plugin will continue working properly and record network information, handled exceptions, events, and any crash that might occur.
Use the following methods to start, close, and flush sessions:
- To explicitly start the session, use the startSession: method. (If a previous session was initialized less than one minute earlier, this call is ignored.)
- To close the active session, use the closeSession method.
- To manually flush all saved data, use the flush: method.
- To only send data over a WiFi connection, use the enableFlushOnlyOverWiFi: method.
Example code
If there are logged handled exceptions, custom events, or any network interception captured by Splunk MINT and you don't want to wait for another initAndStartSessionWithAPIKey use the flush: method to immediately send any logged requests to the Splunk server.
// Objective-C [[Mint sharedInstance] startSession]; [[Mint sharedInstance] closeSession]; [[Mint sharedInstance] enableFlushOnlyOverWiFi:YES]; [[Mint sharedInstance] flush];
// Swift Mint.sharedInstance().startSession() Mint.sharedInstance().closeSession() Mint.sharedInstance().enableFlushOnlyOverWiFi(true) Mint.sharedInstance().flush()
Add Splunk MINT to your iOS project | Monitor transactions |
This documentation applies to the following versions of Splunk MINT™ SDK for iOS (EOL): 5.0.x, 5.1.x
Feedback submitted, thanks!