Skip to main content
Version: 1.3.x

Using Engagespot Flutter Library

The Engagespot SDK for Flutter provides functionalities to integrate the Engagespot service into your Flutter applications. With this SDK, you can handle notifications, mark notifications as read, register Firebase Cloud Messaging (FCM) tokens, and listen to real-time notification events.


To use the Engagespot SDK in your Flutter project, follow these steps:

  1. Add the engagespot_sdk dependency to your pubspec.yaml file:
engagespot_sdk: ^1.0.0
  1. Install the package by running the following command in your terminal:
flutter pub get


Initializing the SDK

Before using any functionalities of the Engagespot SDK, you need to initialize it with your API key and secret. You can do this by calling the initSdk method:

apiKey: 'your_api_key',
isDebug: true, // Set to true for debugging

Logging in User

To login a user, use the loginUser method:

Engagespot.loginUser(userId: 'user_id');

Marking Notifications as Read

You can mark all notifications as read using the markAsRead method:


Registering FCM Tokens

To register FCM tokens with Engagespot, use the registerFCM method:


Listening to Notification Events

You can listen to real-time notification events using the listenMessage method. Provide callbacks to handle incoming messages and when all notifications are marked as read:

onMessage: (EsMessage es) {
// Handle incoming message


Getting Notifications

Retrieve notifications using the getNotifications method. This returns a NotificationSet object containing unread notification count and a list of notifications:

NotificationSet notificationSet = await Engagespot.getNotifications();
int unreadCount = notificationSet.unReadCount;
List<EsMessage> notifications = notificationSet.NotificationMessage;


  • Ensure that you have the necessary permissions and configurations set up on the Engagespot dashboard before using the SDK functionalities.
  • Handle errors and edge cases appropriately in your application logic.
  • Refer to the Engagespot API documentation for more details on available endpoints and functionalities.

That's it! You've successfully integrated the Engagespot SDK into your Flutter application. Happy coding!# engagespot