|  |  |  | @ -1,13 +1,11 @@ | 
		
	
		
			
				|  |  |  |  | import 'dart:convert'; | 
		
	
		
			
				|  |  |  |  | import 'dart:io'; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | import 'package:firebase_messaging/firebase_messaging.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/app_state/app_state.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/main.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:permission_handler/permission_handler.dart'; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); | 
		
	
		
			
				|  |  |  |  | //final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | class AppNotifications { | 
		
	
	
		
			
				
					|  |  |  | @ -19,21 +17,21 @@ class AppNotifications { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> requestPermissions() async { | 
		
	
		
			
				|  |  |  |  |     if (Platform.isIOS) { | 
		
	
		
			
				|  |  |  |  |       await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true); | 
		
	
		
			
				|  |  |  |  |      // await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true); | 
		
	
		
			
				|  |  |  |  |     } else if (Platform.isAndroid) { | 
		
	
		
			
				|  |  |  |  |       AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>(); | 
		
	
		
			
				|  |  |  |  |       bool? granted = await androidImplementation?.requestPermission(); | 
		
	
		
			
				|  |  |  |  |       if (granted == false) { | 
		
	
		
			
				|  |  |  |  |         print("-------------------- Permission Granted ------------------------"); | 
		
	
		
			
				|  |  |  |  |         print(granted); | 
		
	
		
			
				|  |  |  |  |         await Permission.notification.request(); | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |    //   AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>(); | 
		
	
		
			
				|  |  |  |  |     //  bool? granted = await androidImplementation?.requestPermission(); | 
		
	
		
			
				|  |  |  |  |     //   if (granted == false) { | 
		
	
		
			
				|  |  |  |  |     //     print("-------------------- Permission Granted ------------------------"); | 
		
	
		
			
				|  |  |  |  |     //     print(granted); | 
		
	
		
			
				|  |  |  |  |     //     await Permission.notification.request(); | 
		
	
		
			
				|  |  |  |  |     //   } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Future<void> isAndroidPermGranted() async { | 
		
	
		
			
				|  |  |  |  |     if (Platform.isAndroid) { | 
		
	
		
			
				|  |  |  |  |       bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()?.areNotificationsEnabled() ?? false; | 
		
	
		
			
				|  |  |  |  |      // bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()?.areNotificationsEnabled() ?? false; | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | 
 |