Ionic / Capacitor
Callbacks
Get Started
SDKs
- Javascript
- iOS
- Android
- ReactNative
- Flutter
- FlutterFlow
- Ionic / Capacitor
- Introducing
- User identity
- Track events
- Track pages
- Forms
- Push notifications
- In-app notifications
- Audio recording
- Console logs
- Custom actions
- Custom data
- Callbacks
- Tags
- Feedback button
- Network logs
- Translations
- Widget control
- Prefill the widget form
- Conversations
- Feature requests
- Help center
- Release notes & news
- Surveys
- Checklists
- Cordova
Ionic / Capacitor
Callbacks
Use the following callbacks to get notified on certain state changes of the Gleap widget. This enables you to create an even deeper integration with Gleap.
Gleap.setEventCallback((message, err) => {
const { name, data } = message;
if (name === "open") {
// Widget openend
}
if (name === "close") {
// Widget openend
}
if (name === "notification-count-updated") {
// Notification count changed
console.log("Unread notifications", data);
}
if (name === "feedback-sent") {
// Feedback sent
console.log("Form data: ", data);
}
if (name === "outbound-sent") {
// Feedback sent
console.log("Outbound data: ", data);
}
if (name === "flow-started") {
// Flow started
console.log("Flow: ", data);
}
if (name === "error-while-sending") {
// Error while sending
}
if (name === "custom-action-called") {
// Custom action called
console.log("Custom action: ", data);
}
});