ente/lib/services/notification_service.dart
2022-11-01 11:43:06 +05:30

54 lines
1.7 KiB
Dart

// import 'dart:io';
//
// import 'package:flutter_local_notifications/flutter_local_notifications.dart';
//
// class NotificationService {
// static final NotificationService instance =
// NotificationService._privateConstructor();
//
// NotificationService._privateConstructor();
// final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
// FlutterLocalNotificationsPlugin();
//
// Future<void> init() async {
// if (!Platform.isAndroid) {
// return;
// }
// const AndroidInitializationSettings initializationSettingsAndroid =
// AndroidInitializationSettings('notification_icon');
// const InitializationSettings initializationSettings =
// InitializationSettings(
// android: initializationSettingsAndroid,
// );
// await _flutterLocalNotificationsPlugin.initialize(
// initializationSettings,
// onSelectNotification: selectNotification,
// );
// }
//
// Future selectNotification(String? payload) async {}
//
// Future<void> showNotification(String title, String message) async {
// if (!Platform.isAndroid) {
// return;
// }
// const AndroidNotificationDetails androidPlatformChannelSpecifics =
// AndroidNotificationDetails(
// 'io.ente.photos',
// 'ente',
// channelDescription: 'ente alerts',
// importance: Importance.max,
// priority: Priority.high,
// showWhen: false,
// );
// const NotificationDetails platformChannelSpecifics =
// NotificationDetails(android: androidPlatformChannelSpecifics);
// await _flutterLocalNotificationsPlugin.show(
// 0,
// title,
// message,
// platformChannelSpecifics,
// );
// }
// }