notif fix on firebase
This commit is contained in:
parent
d782fe2404
commit
79f0f28578
|
|
@ -1,9 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||||
<true/>
|
<true />
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|
@ -23,9 +23,9 @@
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<false/>
|
<false />
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true />
|
||||||
<key>NSCameraUsageDescription</key>
|
<key>NSCameraUsageDescription</key>
|
||||||
<string>We need to access to the user gallery to add user profile photo</string>
|
<string>We need to access to the user gallery to add user profile photo</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
<string>We need to access to the user gallery to add user profile photo</string>
|
<string>We need to access to the user gallery to add user profile photo</string>
|
||||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
<true/>
|
<true />
|
||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>audio</string>
|
<string>audio</string>
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false />
|
||||||
<key>UNNotificationServiceExtension</key>
|
<key>UNNotificationServiceExtension</key>
|
||||||
<array>
|
<array>
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER).MyNotificationServiceExtension</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER).MyNotificationServiceExtension</string>
|
||||||
|
|
@ -63,7 +63,11 @@
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSAllowsArbitraryLoads</key>
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
<true/>
|
<true />
|
||||||
|
</dict>
|
||||||
|
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||||
|
<array>
|
||||||
|
<string>dev.flutter.background.refresh</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
|
||||||
</plist>
|
</plist>
|
||||||
|
|
@ -15,6 +15,7 @@ import 'package:didvan/providers/user.dart';
|
||||||
import 'package:didvan/routes/route_generator.dart';
|
import 'package:didvan/routes/route_generator.dart';
|
||||||
import 'package:didvan/routes/routes.dart';
|
import 'package:didvan/routes/routes.dart';
|
||||||
import 'package:didvan/services/app_home_widget/home_widget_repository.dart';
|
import 'package:didvan/services/app_home_widget/home_widget_repository.dart';
|
||||||
|
import 'package:didvan/services/back_services.dart';
|
||||||
import 'package:didvan/services/media/media.dart';
|
import 'package:didvan/services/media/media.dart';
|
||||||
import 'package:didvan/services/notification/firebase_api.dart';
|
import 'package:didvan/services/notification/firebase_api.dart';
|
||||||
import 'package:didvan/services/notification/notification_service.dart';
|
import 'package:didvan/services/notification/notification_service.dart';
|
||||||
|
|
@ -32,24 +33,23 @@ import 'package:provider/provider.dart';
|
||||||
|
|
||||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
@pragma('vm:entry-point')
|
// @pragma('vm:entry-point')
|
||||||
Future _initPushNotification(RemoteMessage message) async {
|
// Future _initPushNotification(RemoteMessage message) async {
|
||||||
if (!kIsWeb) {
|
// if (!kIsWeb) {
|
||||||
await NotificationService.initializeNotification();
|
// await NotificationService.startListeningNotificationEvents();
|
||||||
}
|
// }
|
||||||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
// await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||||
// if (kDebugMode) {
|
// // if (kDebugMode) {
|
||||||
print("background: ${NotificationData.fromJson(message.data).toJson()}");
|
// print("background: ${NotificationData.fromJson(message.data).toJson()}");
|
||||||
// }
|
// // }
|
||||||
try {
|
// try {
|
||||||
NotificationService.showFirebaseNotification(message);
|
// NotificationService.showFirebaseNotification(message);
|
||||||
NotificationService.startListeningNotificationEvents();
|
// } catch (e) {
|
||||||
} catch (e) {
|
// // if (kDebugMode) {
|
||||||
// if (kDebugMode) {
|
// print(e);
|
||||||
print(e);
|
// // }
|
||||||
// }
|
// }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
@pragma('vm:entry-point')
|
@pragma('vm:entry-point')
|
||||||
Future<void> _backgroundCallbackHomeWidget(Uri? uri) async {
|
Future<void> _backgroundCallbackHomeWidget(Uri? uri) async {
|
||||||
|
|
@ -65,7 +65,6 @@ Future<void> _backgroundCallbackHomeWidget(Uri? uri) async {
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!kIsWeb) {
|
if (!kIsWeb) {
|
||||||
HomeWidget.registerBackgroundCallback(_backgroundCallbackHomeWidget);
|
HomeWidget.registerBackgroundCallback(_backgroundCallbackHomeWidget);
|
||||||
|
|
@ -73,7 +72,7 @@ void main() async {
|
||||||
await NotificationService.initializeNotification();
|
await NotificationService.initializeNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
FirebaseMessaging.onBackgroundMessage(_initPushNotification);
|
// FirebaseMessaging.onBackgroundMessage(_initPushNotification);
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
options: DefaultFirebaseOptions.currentPlatform);
|
options: DefaultFirebaseOptions.currentPlatform);
|
||||||
await FirebaseApi().initNotification();
|
await FirebaseApi().initNotification();
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,7 @@ class UserProvider extends CoreProvier {
|
||||||
value: service.result['user']['end'],
|
value: service.result['user']['end'],
|
||||||
);
|
);
|
||||||
|
|
||||||
FirebaseApi()
|
await _registerFirebaseToken();
|
||||||
.initNotification()
|
|
||||||
.then((value) => _registerFirebaseToken());
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
import 'dart:async';
|
||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:didvan/firebase_options.dart';
|
||||||
|
import 'package:didvan/models/notification_data.dart';
|
||||||
|
import 'package:didvan/services/notification/notification_service.dart';
|
||||||
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter_background_service/flutter_background_service.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
Future<void> initializeService() async {
|
||||||
|
final service = FlutterBackgroundService();
|
||||||
|
await service.configure(
|
||||||
|
iosConfiguration: IosConfiguration(
|
||||||
|
autoStart: true,
|
||||||
|
onForeground: onStart,
|
||||||
|
onBackground: onIosBackground),
|
||||||
|
androidConfiguration: AndroidConfiguration(
|
||||||
|
onStart: onStart,
|
||||||
|
isForegroundMode: true,
|
||||||
|
autoStart: true,
|
||||||
|
autoStartOnBoot: true));
|
||||||
|
}
|
||||||
|
|
||||||
|
@pragma('vm:entry-point')
|
||||||
|
Future<bool> onIosBackground(ServiceInstance service) async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
DartPluginRegistrant.ensureInitialized();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@pragma('vm:entry-point')
|
||||||
|
void onStart(ServiceInstance service) {
|
||||||
|
DartPluginRegistrant.ensureInitialized();
|
||||||
|
if (service is AndroidServiceInstance) {
|
||||||
|
service.on('setAsForeground').listen((event) {
|
||||||
|
service.setAsForegroundService();
|
||||||
|
});
|
||||||
|
service.on('setAsBackground').listen((event) {
|
||||||
|
service.setAsBackgroundService();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
service.on('stopService').listen((event) {
|
||||||
|
service.stopSelf();
|
||||||
|
});
|
||||||
|
Timer.periodic(const Duration(seconds: 1), (timer) async {
|
||||||
|
if (service is AndroidServiceInstance) {
|
||||||
|
if (await service.isForegroundService()) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
NotificationService.startListeningNotificationEvents();
|
||||||
|
print('background service running');
|
||||||
|
service.invoke('update');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ import 'package:didvan/services/notification/notification_service.dart';
|
||||||
import 'package:didvan/services/storage/storage.dart';
|
import 'package:didvan/services/storage/storage.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class FirebaseApi {
|
class FirebaseApi {
|
||||||
|
|
@ -33,11 +34,34 @@ class FirebaseApi {
|
||||||
sound: true,
|
sound: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
FirebaseMessaging.instance
|
final initMsg = await FirebaseMessaging.instance.getInitialMessage();
|
||||||
.getInitialMessage()
|
|
||||||
.asStream()
|
if (initMsg != null) {
|
||||||
.listen((event) async {});
|
try {
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen((event) {});
|
NotificationMessage data = NotificationMessage.fromJson(initMsg.data);
|
||||||
|
HomeWidgetRepository.data = data;
|
||||||
|
print("data: ${HomeWidgetRepository.data}");
|
||||||
|
await HomeWidgetRepository.decideWhereToGoNotif();
|
||||||
|
await StorageService.delete(
|
||||||
|
key: 'notification${AppInitializer.createNotificationId(data)}');
|
||||||
|
} catch (e) {
|
||||||
|
e.printError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FirebaseMessaging.onMessageOpenedApp.listen((initMsg) async {
|
||||||
|
try {
|
||||||
|
NotificationMessage data = NotificationMessage.fromJson(initMsg.data);
|
||||||
|
HomeWidgetRepository.data = data;
|
||||||
|
print("data: ${HomeWidgetRepository.data}");
|
||||||
|
await HomeWidgetRepository.decideWhereToGoNotif();
|
||||||
|
await StorageService.delete(
|
||||||
|
key: 'notification${AppInitializer.createNotificationId(data)}');
|
||||||
|
} catch (e) {
|
||||||
|
e.printError();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
FirebaseMessaging.onMessage.listen((event) => handleMessage(event));
|
FirebaseMessaging.onMessage.listen((event) => handleMessage(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,6 +70,13 @@ class FirebaseApi {
|
||||||
//do ever you want with message
|
//do ever you want with message
|
||||||
// if (kDebugMode) {
|
// if (kDebugMode) {
|
||||||
print("forground: ${NotificationData.fromJson(message.data).toJson()}");
|
print("forground: ${NotificationData.fromJson(message.data).toJson()}");
|
||||||
|
const platform = MethodChannel('com.didvan.didvanapp/notification');
|
||||||
|
|
||||||
|
await platform.invokeMethod('showNotification', {
|
||||||
|
'title': message.notification!.title,
|
||||||
|
'message': message.notification!.body
|
||||||
|
});
|
||||||
|
|
||||||
// }
|
// }
|
||||||
try {
|
try {
|
||||||
await NotificationService.showFirebaseNotification(message);
|
await NotificationService.showFirebaseNotification(message);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import 'package:didvan/services/app_initalizer.dart';
|
||||||
import 'package:didvan/services/storage/storage.dart';
|
import 'package:didvan/services/storage/storage.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
class NotificationService {
|
class NotificationService {
|
||||||
|
|
@ -163,3 +164,47 @@ class NotificationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class NotificationHelper {
|
||||||
|
static final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||||
|
FlutterLocalNotificationsPlugin();
|
||||||
|
|
||||||
|
static Future<void> initialized() async {
|
||||||
|
const AndroidInitializationSettings initializationSettingsAndroid =
|
||||||
|
AndroidInitializationSettings('@mipmap/ic_launcher');
|
||||||
|
final initializationSettingsIos = DarwinInitializationSettings(
|
||||||
|
requestAlertPermission: true,
|
||||||
|
requestBadgePermission: true,
|
||||||
|
requestSoundPermission: true,
|
||||||
|
onDidReceiveLocalNotification: (id, title, body, payload) async {},
|
||||||
|
);
|
||||||
|
|
||||||
|
await flutterLocalNotificationsPlugin.initialize(
|
||||||
|
InitializationSettings(
|
||||||
|
android: initializationSettingsAndroid,
|
||||||
|
iOS: initializationSettingsIos),
|
||||||
|
onDidReceiveNotificationResponse: (details) {
|
||||||
|
print("onDidReceiveNotificationResponse: ${details}");
|
||||||
|
}, onDidReceiveBackgroundNotificationResponse: localBackgroundHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void displayNotification(RemoteMessage message) async {
|
||||||
|
try {
|
||||||
|
final id = DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||||
|
const notifDetails = NotificationDetails(
|
||||||
|
android: AndroidNotificationDetails(
|
||||||
|
'push_notificatiion', 'push_notificatiion_channel',
|
||||||
|
importance: Importance.max, priority: Priority.high));
|
||||||
|
|
||||||
|
await flutterLocalNotificationsPlugin.show(
|
||||||
|
id, message.data['title'], message.data['body'], notifDetails);
|
||||||
|
} on Exception catch (e) {
|
||||||
|
e.printError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@pragma('vm:entry-point')
|
||||||
|
Future<void> localBackgroundHandler(NotificationResponse data) async {
|
||||||
|
print("onDidReceiveBackgroundNotificationResponse: ${data}");
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ class _WebViewState extends State<WebView> {
|
||||||
void initState() {
|
void initState() {
|
||||||
controller = WebViewController()
|
controller = WebViewController()
|
||||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||||
..setBackgroundColor(Theme.of(context).colorScheme.background)
|
|
||||||
..setNavigationDelegate(
|
..setNavigationDelegate(
|
||||||
NavigationDelegate(
|
NavigationDelegate(
|
||||||
onProgress: (int progress) {
|
onProgress: (int progress) {
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ class _DidvanPageViewState extends State<DidvanPageView> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
AppInitializer.openWebLink(content, href,
|
AppInitializer.openWebLink(context, href,
|
||||||
mode: LaunchMode.inAppWebView);
|
mode: LaunchMode.inAppWebView);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
64
pubspec.lock
64
pubspec.lock
|
|
@ -358,6 +358,38 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_background_service:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_background_service
|
||||||
|
sha256: d32f078ec57647c9cfd6e1a8da9297f7d8f021d4dcc204a35aaad2cdbfe255f0
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.10"
|
||||||
|
flutter_background_service_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_background_service_android
|
||||||
|
sha256: "39da42dddf877beeef82bc2583130d8bedb4d0765e99ca9e7b4a32e8c6abd239"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.2.7"
|
||||||
|
flutter_background_service_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_background_service_ios
|
||||||
|
sha256: "6037ffd45c4d019dab0975c7feb1d31012dd697e25edc05505a4a9b0c7dc9fba"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.3"
|
||||||
|
flutter_background_service_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_background_service_platform_interface
|
||||||
|
sha256: ca74aa95789a8304f4d3f57f07ba404faa86bed6e415f83e8edea6ad8b904a41
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.1.2"
|
||||||
flutter_cache_manager:
|
flutter_cache_manager:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -382,6 +414,30 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.3"
|
version: "2.0.3"
|
||||||
|
flutter_local_notifications:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_local_notifications
|
||||||
|
sha256: c500d5d9e7e553f06b61877ca6b9c8b92c570a4c8db371038702e8ce57f8a50f
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "17.2.2"
|
||||||
|
flutter_local_notifications_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_local_notifications_linux
|
||||||
|
sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.1"
|
||||||
|
flutter_local_notifications_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_local_notifications_platform_interface
|
||||||
|
sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.2.0"
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
@ -1098,6 +1154,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.1"
|
version: "0.6.1"
|
||||||
|
timezone:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: timezone
|
||||||
|
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.9.4"
|
||||||
toggle_switch:
|
toggle_switch:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,8 @@ dependencies:
|
||||||
mime: ^1.0.2
|
mime: ^1.0.2
|
||||||
path: any
|
path: any
|
||||||
flutter_cache_manager: any
|
flutter_cache_manager: any
|
||||||
|
flutter_local_notifications: ^17.2.2
|
||||||
|
flutter_background_service: ^5.0.10
|
||||||
# url_launcher: ^6.3.0
|
# url_launcher: ^6.3.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,16 @@
|
||||||
|
|
||||||
<!-- Favicon -->
|
<!-- Favicon -->
|
||||||
<link rel="icon" type="image/png" href="favicon.png" />
|
<link rel="icon" type="image/png" href="favicon.png" />
|
||||||
<script>
|
<script src="flutter_bootstrap.js" async>
|
||||||
// Import the functions you need from the SDKs you need
|
if ('serviceWorker' in navigator) {
|
||||||
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.9.1/firebase-app.js";
|
window.addEventListener('load', function () {
|
||||||
import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.9.1/firebase-analytics.js";
|
navigator.serviceWorker.register('firebase-messaging-sw.js', {
|
||||||
import { getMessaging } from "https://www.gstatic.com/firebasejs/9.9.1/firebase-messagin.js";
|
scope: '/firebase-cloud-messaging-push-scope',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<title>Didvan</title>
|
<title>Didvan</title>
|
||||||
<link rel="manifest" href="manifest.json" />
|
<link rel="manifest" href="manifest.json" />
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue