Issue callback listener
Single function with callback to get notified when an issue is detected by the SDK.
You can listen for and access every issue in realtime using the Fn.listenForIssue() API.
You need to add the listener in your AppDelegate class. Register only a single global listener to get callbacks for all issues detected by the SDK.
AppDelegate
- Objective C
- Swift
[Fn listenForIssues:@selector(issueFound:) atTarget:self];
}
(void) issueFound:(Issue *) issue {
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Fn.initialize(application)
Fn.listenForIssues(forSelector: #selector(issueReported(_:)), atTarget: self)
return true
}
@objc func issueReported(_ issue:Issue){
}
The callback will have an Issue object that contains all the issue properties that are being synced to the server, making the whole process transparent.
The callback will be executed in a background thread, so make sure to use UI thread inside the callback function to implement any UI related actions. This callback is triggered right after an issue occurrence.