notificationHandler method
Future<FlutterLocalNotificationsPlugin>
notificationHandler(
- FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin, {
- BuildContext? context,
- void onDidRecieve(
- NotificationResponse
Implementation
Future<FlutterLocalNotificationsPlugin> notificationHandler(
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
{BuildContext? context,void Function(NotificationResponse)? onDidRecieve}) async {
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
DarwinInitializationSettings iosSetting = DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: true);
var initializationSettingsAndroid = AndroidInitializationSettings('sellon');
var initializationSettings = InitializationSettings(
android: initializationSettingsAndroid, iOS: iosSetting);
await flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: onDidRecieve,
);
return flutterLocalNotificationsPlugin;
}