|
|
|
@ -18,10 +18,16 @@ class NotificationService {
|
|
|
|
requestBadgePermission: true,
|
|
|
|
requestBadgePermission: true,
|
|
|
|
requestSoundPermission: true,
|
|
|
|
requestSoundPermission: true,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
const macSettings = DarwinInitializationSettings(
|
|
|
|
|
|
|
|
requestAlertPermission: true,
|
|
|
|
|
|
|
|
requestBadgePermission: true,
|
|
|
|
|
|
|
|
requestSoundPermission: true,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const initSettings = InitializationSettings(
|
|
|
|
const initSettings = InitializationSettings(
|
|
|
|
android: androidSettings,
|
|
|
|
android: androidSettings,
|
|
|
|
iOS: iosSettings,
|
|
|
|
iOS: iosSettings,
|
|
|
|
|
|
|
|
macOS: macSettings,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
@ -90,9 +96,17 @@ class NotificationService {
|
|
|
|
badgeNumber: badgeCount,
|
|
|
|
badgeNumber: badgeCount,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final macDetails = DarwinNotificationDetails(
|
|
|
|
|
|
|
|
presentAlert: true,
|
|
|
|
|
|
|
|
presentBadge: true,
|
|
|
|
|
|
|
|
presentSound: true,
|
|
|
|
|
|
|
|
badgeNumber: badgeCount,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
final notificationDetails = NotificationDetails(
|
|
|
|
final notificationDetails = NotificationDetails(
|
|
|
|
android: androidDetails,
|
|
|
|
android: androidDetails,
|
|
|
|
iOS: iosDetails,
|
|
|
|
iOS: iosDetails,
|
|
|
|
|
|
|
|
macOS: macDetails,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
await _notifications.show(
|
|
|
|
await _notifications.show(
|
|
|
|
@ -128,9 +142,16 @@ class NotificationService {
|
|
|
|
presentSound: true,
|
|
|
|
presentSound: true,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const macDetails = DarwinNotificationDetails(
|
|
|
|
|
|
|
|
presentAlert: true,
|
|
|
|
|
|
|
|
presentBadge: true,
|
|
|
|
|
|
|
|
presentSound: true,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const notificationDetails = NotificationDetails(
|
|
|
|
const notificationDetails = NotificationDetails(
|
|
|
|
android: androidDetails,
|
|
|
|
android: androidDetails,
|
|
|
|
iOS: iosDetails,
|
|
|
|
iOS: iosDetails,
|
|
|
|
|
|
|
|
macOS: macDetails,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
await _notifications.show(
|
|
|
|
await _notifications.show(
|
|
|
|
@ -169,9 +190,17 @@ class NotificationService {
|
|
|
|
badgeNumber: badgeCount,
|
|
|
|
badgeNumber: badgeCount,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final macDetails = DarwinNotificationDetails(
|
|
|
|
|
|
|
|
presentAlert: true,
|
|
|
|
|
|
|
|
presentBadge: true,
|
|
|
|
|
|
|
|
presentSound: true,
|
|
|
|
|
|
|
|
badgeNumber: badgeCount,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
final notificationDetails = NotificationDetails(
|
|
|
|
final notificationDetails = NotificationDetails(
|
|
|
|
android: androidDetails,
|
|
|
|
android: androidDetails,
|
|
|
|
iOS: iosDetails,
|
|
|
|
iOS: iosDetails,
|
|
|
|
|
|
|
|
macOS: macDetails,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
final preview = _truncateMessage(message, 30);
|
|
|
|
final preview = _truncateMessage(message, 30);
|
|
|
|
|