initializePlatformSpecifics method
dynamic
initializePlatformSpecifics()
Initialized Notification Settings
Implementation
initializePlatformSpecifics() async {
var initializationSettingsAndroid = const AndroidInitializationSettings('@mipmap/ic_launcher');
var initializationSettingsIOS = DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: false,
onDidReceiveLocalNotification: (id, title, body, payload) async {
var receivedNotification = ReceivedNotification(
id: id,
title: title!,
body: body!,
payload: payload!,
);
print('receivedNotification: ${receivedNotification.toString()}');
// didReceivedLocalNotificationSubject.add(receivedNotification);
},
);
initializationSettings =
InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
await _notificationsPlugin.initialize(
initializationSettings,
);
}