Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions lib/services/background_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:background_fetch/background_fetch.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import '../models/journal_entity.dart';
import '../services/database_helper.dart';
import '../services/feed_service.dart';
import '../generated_l10n/app_localizations.dart';
import 'package:wispar/models/journal_entity.dart';
import 'package:wispar/services/database_helper.dart';
import 'package:wispar/services/feed_service.dart';
import 'package:wispar/generated_l10n/app_localizations.dart';

final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
Expand All @@ -27,7 +27,8 @@ Future<void> initializeNotifications() async {
iOS: initializationSettingsDarwin,
);

await flutterLocalNotificationsPlugin.initialize(initializationSettings);
await flutterLocalNotificationsPlugin.initialize(
settings: initializationSettings);
}

Future<void> showNewJournalArticlesNotification() async {
Expand All @@ -54,10 +55,10 @@ Future<void> showNewJournalArticlesNotification() async {
NotificationDetails(android: androidPlatformChannelSpecifics);

await flutterLocalNotificationsPlugin.show(
0,
notificationTitle,
notificationContent,
platformChannelSpecifics,
id: 0,
title: notificationTitle,
body: notificationContent,
notificationDetails: platformChannelSpecifics,
);
}

Expand Down Expand Up @@ -85,10 +86,10 @@ Future<void> showNewQueryArticlesNotification() async {
NotificationDetails(android: androidPlatformChannelSpecifics);

await flutterLocalNotificationsPlugin.show(
1,
notificationTitle,
notificationContent,
platformChannelSpecifics,
id: 1,
title: notificationTitle,
body: notificationContent,
notificationDetails: platformChannelSpecifics,
);
}

Expand All @@ -98,7 +99,7 @@ Future<void> runFeedJob(
int fetchIntervalInHours,
int maxConcurrentUpdates,
) async {
debugPrint('Feed updated in background at ${DateTime.now()}');
//debugPrint('Feed updated in background at ${DateTime.now()}');

int journalArticleCountBefore = await dbHelper.getArticleCount();

Expand All @@ -114,7 +115,7 @@ Future<void> runFeedJob(
if (journalArticleCountBefore < journalArticleCountAfter) {
await showNewJournalArticlesNotification();
} else {
debugPrint("No new articles from journals received");
//debugPrint("No new articles from journals received");
}

int queryArticleCountBefore = await dbHelper.getArticleCount();
Expand All @@ -130,7 +131,7 @@ Future<void> runFeedJob(
if (queryArticleCountBefore < queryArticleCountAfter) {
await showNewQueryArticlesNotification();
} else {
debugPrint("No new articles from queries received");
//debugPrint("No new articles from queries received");
}
}

Expand Down
60 changes: 30 additions & 30 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: "direct main"
description:
name: archive
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff
url: "https://pub.dev"
source: hosted
version: "4.0.7"
version: "4.0.9"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -149,10 +149,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c
sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
version: "2.2.0"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -306,34 +306,34 @@ packages:
dependency: "direct main"
description:
name: flutter_local_notifications
sha256: "19ffb0a8bb7407875555e5e98d7343a633bb73707bae6c6a5f37c90014077875"
sha256: "2b50e938a275e1ad77352d6a25e25770f4130baa61eaf02de7a9a884680954ad"
url: "https://pub.dev"
source: hosted
version: "19.5.0"
version: "20.1.0"
flutter_local_notifications_linux:
dependency: transitive
description:
name: flutter_local_notifications_linux
sha256: e3c277b2daab8e36ac5a6820536668d07e83851aeeb79c446e525a70710770a5
sha256: dce0116868cedd2cdf768af0365fc37ff1cbef7c02c4f51d0587482e625868d0
url: "https://pub.dev"
source: hosted
version: "6.0.0"
version: "7.0.0"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
sha256: "277d25d960c15674ce78ca97f57d0bae2ee401c844b6ac80fcd972a9c99d09fe"
sha256: "23de31678a48c084169d7ae95866df9de5c9d2a44be3e5915a2ff067aeeba899"
url: "https://pub.dev"
source: hosted
version: "9.1.0"
version: "10.0.0"
flutter_local_notifications_windows:
dependency: transitive
description:
name: flutter_local_notifications_windows
sha256: "8d658f0d367c48bd420e7cf2d26655e2d1130147bca1eea917e576ca76668aaf"
sha256: e97a1a3016512437d9c0b12fae7d1491c3c7b9aa7f03a69b974308840656b02a
url: "https://pub.dev"
source: hosted
version: "1.0.3"
version: "2.0.1"
flutter_localizations:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -441,10 +441,10 @@ packages:
dependency: transitive
description:
name: image
sha256: "492bd52f6c4fbb6ee41f781ff27765ce5f627910e1e0cbecfa3d9add5562604c"
sha256: f9881ff4998044947ec38d098bc7c8316ae1186fa786eddffdb867b9bc94dfce
url: "https://pub.dev"
source: hosted
version: "4.7.2"
version: "4.8.0"
intl:
dependency: "direct main"
description:
Expand All @@ -465,10 +465,10 @@ packages:
dependency: "direct main"
description:
name: json_annotation
sha256: "805fa86df56383000f640384b282ce0cb8431f1a7a2396de92fb66186d8c57df"
sha256: cb09e7dac6210041fad964ed7fbee004f14258b4eca4040f72d1234062ace4c8
url: "https://pub.dev"
source: hosted
version: "4.10.0"
version: "4.11.0"
latext:
dependency: "direct main"
description:
Expand Down Expand Up @@ -753,10 +753,10 @@ packages:
dependency: transitive
description:
name: petitparser
sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1"
sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675"
url: "https://pub.dev"
source: hosted
version: "7.0.1"
version: "7.0.2"
platform:
dependency: transitive
description:
Expand All @@ -777,10 +777,10 @@ packages:
dependency: transitive
description:
name: posix
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07"
url: "https://pub.dev"
source: hosted
version: "6.0.3"
version: "6.5.0"
provider:
dependency: "direct main"
description:
Expand Down Expand Up @@ -841,10 +841,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_android
sha256: cbc40be9be1c5af4dab4d6e0de4d5d3729e6f3d65b89d21e1815d57705644a6f
sha256: "8374d6200ab33ac99031a852eba4c8eb2170c4bf20778b3e2c9eccb45384fb41"
url: "https://pub.dev"
source: hosted
version: "2.4.20"
version: "2.4.21"
shared_preferences_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -950,10 +950,10 @@ packages:
dependency: transitive
description:
name: sqlite3
sha256: c6cfe9b1cc159c9eb8ba174b533a60b5126f9db8c6e34efb127d2bc04bc45034
sha256: b7cf6b37667f6a921281797d2499ffc60fb878b161058d422064f0ddc78f6aa6
url: "https://pub.dev"
source: hosted
version: "3.1.4"
version: "3.1.6"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -1046,10 +1046,10 @@ packages:
dependency: transitive
description:
name: url_launcher_ios
sha256: cfde38aa257dae62ffe79c87fab20165dfdf6988c1d31b58ebf59b9106062aad
sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0"
url: "https://pub.dev"
source: hosted
version: "6.3.6"
version: "6.4.1"
url_launcher_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -1094,10 +1094,10 @@ packages:
dependency: transitive
description:
name: uuid
sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8
sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489"
url: "https://pub.dev"
source: hosted
version: "4.5.2"
version: "4.5.3"
vector_graphics:
dependency: transitive
description:
Expand All @@ -1118,10 +1118,10 @@ packages:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: "201e876b5d52753626af64b6359cd13ac6011b80728731428fd34bc840f71c9b"
sha256: "5a88dd14c0954a5398af544651c7fb51b457a2a556949bfb25369b210ef73a74"
url: "https://pub.dev"
source: hosted
version: "1.1.20"
version: "1.2.0"
vector_math:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies:
open_filex: ^4.7.0
google_nav_bar: ^5.0.7
file_picker: ^10.0.0
flutter_local_notifications: ^19.1.0
flutter_local_notifications: ^20.1.0
permission_handler: ^12.0.0+1
latext: ^0.5.0
html: ^0.15.6
Expand Down