Last updated:
0 purchases
engagespot sdk
Engagespot SDK for Flutter #
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.
Installation #
To use the Engagespot SDK in your Flutter project, follow these steps:
Add the engagespot_sdk dependency to your pubspec.yaml file:
dependencies:
engagespot_sdk: ^1.0.0
copied to clipboard
Install the package by running the following command in your terminal:
flutter pub get
copied to clipboard
Usage #
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:
Engagespot.initSdk(
apiKey: 'your_api_key',
isDebug: true, // Set to true for debugging
);
copied to clipboard
Logging in User #
To login a user, use the loginUser method:
Engagespot.loginUser(userId: 'user_id');
copied to clipboard
Marking Notifications as Read #
You can mark all notifications as read using the markAsRead method:
Engagespot.markAsRead();
copied to clipboard
Registering FCM Tokens #
To register FCM tokens with Engagespot, use the registerFCM method:
Engagespot.registerFCM('your_fcm_token');
copied to clipboard
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:
Engagespot.listenMessage(
onMessage: (EsMessage es) {
// Handle incoming message
}
);
copied to clipboard
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;
copied to clipboard
Note #
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.