initializePlatformNotifications method
Future<void>
initializePlatformNotifications(
- AndroidInitializationSettings initializationSettingsAndroid
Implementation
Future<void> initializePlatformNotifications(
AndroidInitializationSettings initializationSettingsAndroid) async {
tz.initializeTimeZones();
_isAndroidPermissionGranted();
final String timeZone = await FlutterTimezone.getLocalTimezone();
tz.setLocalLocation(tz.getLocation(timeZone));
final DarwinInitializationSettings initializationSettingsIOS =
DarwinInitializationSettings(
requestSoundPermission: true,
requestBadgePermission: true,
requestAlertPermission: true,
onDidReceiveLocalNotification: onDidReceiveLocalNotification);
final InitializationSettings initializationSettings =
InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsIOS,
);
await _localNotifications.initialize(initializationSettings);
}