NeoDay iOS SDK - Feedback
Handling showing Feedback screens automatically or with the FeedbackDelegate
The default behavior of the SDK is to show the Feedback screen whenever one of the SDK's screens is currently visible. However you can implement the FeedbackDelegate in order to control when a Feedback screen is displayed. If you are using the Custom Event Trigger see the section When using Custom Events to trigger Feedback for how to deal with Feedback being displayed.
import NeoDay
class ExampleViewController: UIViewController {
func feedbackExample() {
...
// Assuming the sdk is already created.
sdk.feedbackDelegate = self
...
}
}
extension ExampleViewController: FeedbackDelegate {
func receivedFeedback(viewController: UIViewController) {
// Display the Feedback
}
}
When using Custom Events to trigger Feedback
Caching Feedback
Whenever Custom Event Triggers are used to trigger a Feedback we advise you to handle showing the Feedback yourselve by caching it first. And then to show it when its appropriate to do so within your app.
import NeoDay
class ExampleViewController: UIViewController {
func cachingFeedbackExample() {
...
// Assuming the sdk is already created.
sdk.feedbackDelegate = self
...
}
}
extension ExampleViewController: FeedbackDelegate {
func receivedFeedback(viewController: UIViewController) {
// Cache the viewController and present it at later time inside the app.
}
}
Clearing the Feedback cache
Whenever you remove the stored token from the NeoDay SDK when logging out of your app, the Feedback cache will also need to be cleared. In case your user logs back in with another account while the app is still open, you don't want to accidentally show Feedback that was meant for the previous logged in user.
import NeoDay
class ExampleViewController: UIViewController {
func clearingFeedbackCacheExample() {
...
// Assuming the sdk is already created.
sdk.removeToken()
// Clear the Feedback cache
...
}
}