notification surface fix
This commit is contained in:
@@ -52,9 +52,9 @@ class NotificationService {
|
||||
try {
|
||||
const androidSettings = AndroidInitializationSettings('@mipmap/ic_launcher');
|
||||
const iosSettings = DarwinInitializationSettings(
|
||||
requestAlertPermission: true,
|
||||
requestBadgePermission: true,
|
||||
requestSoundPermission: true,
|
||||
requestAlertPermission: false,
|
||||
requestBadgePermission: false,
|
||||
requestSoundPermission: false,
|
||||
);
|
||||
const initSettings = InitializationSettings(android: androidSettings, iOS: iosSettings);
|
||||
await _plugin.initialize(initSettings);
|
||||
@@ -62,8 +62,8 @@ class NotificationService {
|
||||
final androidPlugin = _plugin.resolvePlatformSpecificImplementation<
|
||||
AndroidFlutterLocalNotificationsPlugin>();
|
||||
await androidPlugin?.createNotificationChannel(_channel);
|
||||
await requestPermissions();
|
||||
await _requestExactAlarmsOnce();
|
||||
// Permissions are asked only once the club is unlocked: reminders are
|
||||
// a member feature, so other users never see the prompts.
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,10 @@ class NotificationService {
|
||||
await cancelAll(); // reminders are a club-member feature
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await requestPermissions();
|
||||
await _requestExactAlarmsOnce();
|
||||
} catch (_) {}
|
||||
final service = GoogleCalendarService();
|
||||
try {
|
||||
final now = DateTime.now();
|
||||
|
||||
Reference in New Issue
Block a user