Get notifications about internal SDK actions
Use the MintNotificationDelegate to get notified of internal SDK events.
In Objective-C, add - (void) loggedRequestHandled:(LoggedRequestEventArgs *)args as a callback to get notified after a request has been sent to the Splunt MINT server with information about the action. For example:
// Objective-C - (void) loggedRequestHandled:(LoggedRequestEventArgs *)args { NSLog(@"Processed logged client request: %@", args.responseResult.clientRequest); NSLog(@"Server response: %@", args.responseResult.serverResponse); }
Add - (void) networkDataLogged:(NetworkDataFixture *)networkData to get notified of any REST client calls that Splunk MINT monitored and get any information that was gathered.
// Objective-C - (void) networkDataLogged:(NetworkDataFixture *)networkData { NSString* networkDataJSON = [networkData toJSONString]; NSLog(@"Network Data Logged: %@", networkDataJSON); }
Here are the same examples in Swift:
// Swift func loggedRequestHandled(args: LoggedRequestEventArgs) { println("Processed logged client request: \(args.responseResult.clientRequest)") } func networkDataLogged(networkData: NetworkDataFixture) { println("Network Data Logged: \(networkData.toJSONString())") }
Add the MintNotificationDelegate to your class interface or private interface and then set the delegate in the Splunk MINT SDK.
// Objective-C [Mint sharedInstance].notificationDelegate = self;
// Swift Mint.sharedInstance().notificationDelegate = self
We recommend that you set the notificationDelegate property before initializing the plugin so you don't miss any pending requests that were sent to the server at initialization.
Report debugging messages | Integrate WebView monitoring |
This documentation applies to the following versions of Splunk MINT™ SDK for iOS (EOL): 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x
Feedback submitted, thanks!