Gleap
Search…
🚩
Events
Use our GleapDelegate to get notified on certain state changes of the Gleap widget. This enables you to create an even deeper integration with Gleap.
1
import Foundation
2
import UIKit
3
import Gleap
4
​
5
// Add the GleapDelegate protocol to your view controller
6
class DemoViewController: UIViewController, GleapDelegate {
7
8
override func viewDidLoad() {
9
// Assign self to the delegate
10
Gleap.sharedInstance().delegate = self;
11
}
12
13
// Add the custom action called implementation
14
func customActionCalled(_ customAction: String) {
15
if (customAction == "MAGIC_ACTION") {
16
print("Magic action got called.")
17
}
18
}
19
20
func configLoaded(_ config: [AnyHashable : Any]) {
21
// Loaded Gleap config
22
}
23
24
func feedbackSent() {
25
// Feedback got sent
26
}
27
28
func feedbackSendingFailed() {
29
// Sending feedback failed
30
}
31
32
func feedbackWillBeSent() {
33
// The feedback will be sent
34
}
35
}
Copied!

​

Last modified 1mo ago
Copy link
Contents