@pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
log("message $message");
await GetStorage.init();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
LocalStorage.instance.setIsPromptAvailable(true);
}
void main() async {
WidgetsFlutterBinding.ensureInitialized();
translations.loadTranslations();
await GetStorage.init();
Utils.initializeTimeZone();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
NotificationService.initialize();
await NotificationService().listenNotification();
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
Get.put(AuthController());
runApp(const MyApp());
}
i want to set boolean value
LocalStorage.instance.setIsPromptAvailable(true);
while get notification on background.