|
|
|
|
@ -15,10 +15,10 @@ class AppNotifications {
|
|
|
|
|
|
|
|
|
|
factory AppNotifications() => _instance;
|
|
|
|
|
|
|
|
|
|
Future<void> requestPermissions() async {
|
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
|
// Future<void> requestPermissions() async {
|
|
|
|
|
// if (Platform.isIOS) {
|
|
|
|
|
// await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true);
|
|
|
|
|
} else if (Platform.isAndroid) {
|
|
|
|
|
// } else if (Platform.isAndroid) {
|
|
|
|
|
// AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
|
|
|
|
|
// bool? granted = await androidImplementation?.requestPermission();
|
|
|
|
|
// if (granted == false) {
|
|
|
|
|
@ -26,14 +26,14 @@ class AppNotifications {
|
|
|
|
|
// print(granted);
|
|
|
|
|
// await Permission.notification.request();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
Future<void> isAndroidPermGranted() async {
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
// Future<void> isAndroidPermGranted() async {
|
|
|
|
|
// if (Platform.isAndroid) {
|
|
|
|
|
// bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()?.areNotificationsEnabled() ?? false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
void initNotification(String? firebaseToken) async {
|
|
|
|
|
// await requestPermissions();
|
|
|
|
|
|