showUploadSuccessNotification method
Future<void>
showUploadSuccessNotification(
- String uploadId
)
Implementation
Future<void> showUploadSuccessNotification(String uploadId) async {
try {
const AndroidNotificationDetails androidDetails =
AndroidNotificationDetails(
'uploads_channel',
'Uploads',
channelDescription: 'Upload completion notifications',
importance: Importance.max,
priority: Priority.high,
showWhen: true,
enableVibration: true,
playSound: true,
);
const DarwinNotificationDetails iosDetails = DarwinNotificationDetails(
presentAlert: true,
presentBadge: true,
presentSound: true,
);
const NotificationDetails details = NotificationDetails(
android: androidDetails,
iOS: iosDetails,
);
await _plugin.show(
uploadId.hashCode,
'Upload Completed',
'Job $uploadId completed successfully.',
details,
);
debugPrint('Success notification shown for: $uploadId');
} catch (e) {
debugPrint('Failed to show success notification: $e');
}
}