Skip to content

Commit

Permalink
fix: notifications working again
Browse files Browse the repository at this point in the history
  • Loading branch information
Benimautner committed Sep 13, 2024
1 parent e3baada commit bbd202f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</manifest>
4 changes: 3 additions & 1 deletion lib/managers/notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class NotificationClass {
tz.TZDateTime.from(scheduledTime, tz.getLocation(currentTimeZone));
if (time.difference(tz.TZDateTime.now(tz.getLocation(currentTimeZone))) <
Duration.zero) return;
print("scheduled notification for time " + time.toString());
await notifsPlugin.zonedSchedule(
id, title, description, time, platformChannelSpecifics,
androidAllowWhileIdle: true,
Expand Down Expand Up @@ -148,10 +149,11 @@ class NotificationClass {
"The task '" + task.title + "' is due.",
notificationsPlugin,
task.dueDate!,
currentTimeZone,
await FlutterTimezone.getLocalTimezone(),
platformChannelSpecificsDueDate,
id: task.id,
);
print("scheduled notification for time " + task.dueDate!.toString());
}
}
print("notifications scheduled successfully");
Expand Down

0 comments on commit bbd202f

Please sign in to comment.