Add Splunk MINT to your iOS project
To use the SDK:
- Include the SplunkMint-iOS library headers in every file where you use Splunk MINT. You can also import the header file in the .pch file of your project to share it globally in your application.
- If you are using Swift, add the Objective-C Bridging header.
- In Xcode, on the Build Settings tab for your target, locate the Swift Compiler - Code Generation section.
- Set the Objective-C Bridging Header to SplunkMint-iOS.h.
- Initialize SplunkMint with one line of code with your API key, preferably in the beginning of your application delegates application:didFinishLaunchingWithOptions:
#import <SplunkMint-iOS/SplunkMint-iOS.h>
Be sure to specify the path and filename, for example:"$(PROJECT_DIR)/SampleSwift/SplunkMint-iOS.framework/Headers/SplunkMint-iOS.h"
// Objective-C - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[Mint sharedInstance] initAndStartSession:@"API_KEY"]; // ... }
// Swift func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { Mint.sharedInstance().initAndStartSession("API_KEY") return true }
The initAndStartSession: method installs the Splunk exception handler and the performance monitor, sends all the saved data and performance metrics to Splunk MINT, and starts a new session for your activity.
- Notes
- To have a better experience with the Splunk MINT dashboards, use numeric versioning schemes, preferably in MAJOR.MINOR.RELEASE format.
- Do not use any other SDKs that perform error reporting with MINT. Conflicts might occur when multiple SDKs are active.
A variable for the crash controller is not required. The sharedInstance static class selector returns the singleton instance reference. You can also set this value to a property, which is recommended when you use the Mint class a lot in any file.
If you crash the app while debugging, the crash will not be reported. To report crashes, you must deploy the app to your device or simulator and then start it outside the debugging environment.
Configure your project for symbolication | Customize session handling |
This documentation applies to the following versions of Splunk MINT™ SDK for iOS (EOL): 4.0.x, 4.1.x
Feedback submitted, thanks!