registerPeriodicTask method

Future<void> registerPeriodicTask(
  1. LocalNotificationModel notification
)

Implementation

Future<void> registerPeriodicTask(LocalNotificationModel notification) async {
  if (notification.repeatInterval == null) {
    throw Exception("Repeat Interval must provide  to periodic notification");
  }
  await Workmanager().registerPeriodicTask(
    "${notification.id}",
    notification.title.toString(),
    frequency: _getFrequency(notification),
    inputData: notification.toJson(),
  );
}