periodicallyShow method
Future<void>
periodicallyShow(
- int id,
- String? title,
- String? body,
- RepeatInterval repeatInterval, {
- AndroidNotificationDetails? notificationDetails,
- String? payload,
- AndroidScheduleMode scheduleMode = AndroidScheduleMode.exact,
override
Periodically show a notification using the specified interval.
For example, specifying a hourly interval means the first time the notification will be an hour after the method has been called and then every hour after that.
This will also require additional setup for the app, especially in the
app's AndroidManifest.xml
file. Please see check the readme for further
details.
Implementation
@override
Future<void> periodicallyShow(
int id,
String? title,
String? body,
RepeatInterval repeatInterval, {
AndroidNotificationDetails? notificationDetails,
String? payload,
AndroidScheduleMode scheduleMode = AndroidScheduleMode.exact,
}) async {
validateId(id);
await _channel.invokeMethod('periodicallyShow', <String, Object?>{
'id': id,
'title': title,
'body': body,
'calledAt': clock.now().millisecondsSinceEpoch,
'repeatInterval': repeatInterval.index,
'platformSpecifics':
_buildPlatformSpecifics(notificationDetails, scheduleMode),
'payload': payload ?? '',
});
}