periodicallyShow method
int
periodicallyShow(
- RepeatInterval? repeatInterval, {
- int? id,
- String? title,
- String? body,
- String? payload,
- bool? androidAllowWhileIdle,
- String? icon,
- Importance? importance,
- Priority? priority,
- StyleInformation? styleInformation,
- bool? playSound,
- AndroidNotificationSound? sound,
- bool? enableVibration,
- List<
int> ? vibrationPattern, - String? groupKey,
- bool? setAsGroupSummary,
- GroupAlertBehavior? groupAlertBehavior,
- bool? autoCancel,
- bool? ongoing,
- Color? color,
- AndroidBitmap<
Object> ? largeIcon, - bool? onlyAlertOnce,
- bool? showWhen,
- int? when,
- bool? usesChronometer,
- bool? channelShowBadge,
- bool? showProgress,
- int? maxProgress,
- int? progress,
- bool? indeterminate,
- AndroidNotificationChannelAction? channelAction,
- bool? enableLights,
- Color? ledColor,
- int? ledOnMs,
- int? ledOffMs,
- String? ticker,
- NotificationVisibility? visibility,
- int? timeoutAfter,
- String? category,
- bool? fullScreenIntent,
- String? shortcutId,
- Int32List? additionalFlags,
- String? subText,
- String? tag,
- bool? presentAlert,
- bool? presentSound,
- bool? presentBadge,
- String? soundFile,
- int? badgeNumber,
- List<
IOSNotificationAttachment> ? attachments, - List<
MacOSNotificationAttachment> ? macAttachments, - String? subtitle,
- String? threadIdentifier,
Show a Notification periodically.
Implementation
int periodicallyShow(
RepeatInterval? repeatInterval, {
int? id,
String? title,
String? body,
String? payload,
bool? androidAllowWhileIdle,
String? icon,
Importance? importance,
Priority? priority,
StyleInformation? styleInformation,
bool? playSound,
AndroidNotificationSound? sound,
bool? enableVibration,
List<int>? vibrationPattern,
String? groupKey,
bool? setAsGroupSummary,
GroupAlertBehavior? groupAlertBehavior,
bool? autoCancel,
bool? ongoing,
Color? color,
AndroidBitmap<Object>? largeIcon,
bool? onlyAlertOnce,
bool? showWhen,
int? when,
bool? usesChronometer,
bool? channelShowBadge,
bool? showProgress,
int? maxProgress,
int? progress,
bool? indeterminate,
AndroidNotificationChannelAction? channelAction,
bool? enableLights,
Color? ledColor,
int? ledOnMs,
int? ledOffMs,
String? ticker,
NotificationVisibility? visibility,
int? timeoutAfter,
String? category,
bool? fullScreenIntent,
String? shortcutId,
Int32List? additionalFlags,
String? subText,
String? tag,
bool? presentAlert,
bool? presentSound,
bool? presentBadge,
String? soundFile,
int? badgeNumber,
List<IOSNotificationAttachment>? attachments,
List<MacOSNotificationAttachment>? macAttachments,
String? subtitle,
String? threadIdentifier,
}) {
repeatInterval ??= _repeatInterval;
if (repeatInterval == null) {
return -1;
}
//
final notificationSpecifics = _notificationDetails(
title,
body,
payload,
androidAllowWhileIdle,
icon,
importance,
priority,
styleInformation,
playSound,
sound,
enableVibration,
vibrationPattern,
groupKey,
setAsGroupSummary,
groupAlertBehavior,
autoCancel,
ongoing,
color,
largeIcon,
onlyAlertOnce,
showWhen,
when,
usesChronometer,
channelShowBadge,
showProgress,
maxProgress,
progress,
indeterminate,
channelAction,
enableLights,
ledColor,
ledOnMs,
ledOffMs,
ticker,
visibility,
timeoutAfter,
category,
fullScreenIntent,
shortcutId,
additionalFlags,
subText,
tag,
presentAlert,
presentSound,
presentBadge,
soundFile,
badgeNumber,
attachments,
macAttachments,
subtitle,
threadIdentifier,
);
if (notificationSpecifics == null) {
id = -1;
} else {
//
try {
//
if (id == null || id < 0) {
id = Random().nextInt(999);
}
_flutterLocalNotificationsPlugin!.periodicallyShow(
id,
title,
body,
repeatInterval,
notificationSpecifics,
payload: payload,
androidAllowWhileIdle: androidAllowWhileIdle!,
);
} catch (ex) {
id = -1;
getError(ex);
}
}
return id;
}