Last updated:
0 purchases
firebase notification scheduler
Flutter Firebase Notification Scheduler #
A simple plugin to schedule your firebase notification with help of this Rapid api
Installation #
Add firebase_notification_scheduler as a dependency in your pubspec.yaml file.
firebase_notification_scheduler : ^0.0.2
copied to clipboard
How to #
Creating API Key's
Signup for the Firebase Notification Scheduler Rapid API and get API Key from here.
Create your authentication key from here
Initialising Package
final FirebaseNotificationScheduler firebaseNotificationScheduler =
FirebaseNotificationScheduler(
authenticationKey: <YOUR-RAPID-API-KEY> ,
rapidApiKey: <YOUR-AUTHENTICATION-KEY>
);
copied to clipboard
Scheduling a notification
//Schedules a notification to the topic 'any' for next minute
final String _payload = {
"to": "/topics/any",
"notification": {
"title": "Title of Your Notification",
"body": "Body of Your Notification"
},
"data": {"key_1": "Value for key_1", "key_2": "Value for key_2"}
}.toString();
final DateTime _now = DateTime.now().toUtc();
final DateTime _dateTimeInUtc = _now.add(const Duration(minutes: 1));
await firebaseNotificationScheduler.scheduleNotification(
payload: _payload, dateTimeInUtc: _dateTimeInUtc);
copied to clipboard
Getting all Scheduled notifications
List<ScheduledNotification> list=await firebaseNotificationScheduler.getAllScheduledNotification();
copied to clipboard
Cancelling a notification
firebaseNotificationScheduler.cancelNotification(messageId: 'k3821Fq0jQ0U-sDXp');
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.