Skip to main content

🚩 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.

import Foundation
import UIKit
import Gleap

// Add the GleapDelegate protocol to your view controller
class DemoViewController: UIViewController, GleapDelegate {

override func viewDidLoad() {
// Assign self to the delegate
Gleap.sharedInstance().delegate = self;
}

// Add the custom action called implementation
func customActionCalled(_ customAction: String) {
if (customAction == "MAGIC_ACTION") {
print("Magic action got called.")
}
}

func configLoaded(_ config: [AnyHashable : Any]) {
// Loaded Gleap config
}

func feedbackSent() {
// Feedback got sent
}

func feedbackSendingFailed() {
// Sending feedback failed
}

func feedbackWillBeSent() {
// The feedback will be sent
}
}