fix: notification permission error

This commit is contained in:
Prateek Sunal 2024-04-13 14:00:23 +05:30
parent 769d2c9bd7
commit 3f99bb5511

View file

@ -23,9 +23,8 @@ class NotificationService {
Future<void> init(
void Function(
NotificationResponse notificationResponse,
)
onNotificationTapped,
SharedPreferences preferences,
) onNotificationTapped,
SharedPreferences preferences,
) async {
_preferences = preferences;
const androidSettings = AndroidInitializationSettings('notification_icon');
@ -72,7 +71,7 @@ class NotificationService {
result = await _notificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestPermission();
?.requestNotificationsPermission();
}
if (result != null) {
await _preferences.setBool(keyGrantedNotificationPermission, result);