mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-25 11:46:06 +02:00
fix(notification): scheduled notifications not working (#909)
* fix(notification): scheduled notifications not working * do not use toJSON since it doesnt work on isolation pattern * fmt
This commit is contained in:
committed by
GitHub
parent
61edbbec0a
commit
8dea78ac7d
@@ -212,7 +212,7 @@ class TauriNotificationManager(
|
||||
createActionIntents(notification, mBuilder)
|
||||
// notificationId is a unique int for each notification that you must define
|
||||
val buildNotification = mBuilder.build()
|
||||
if (notification.isScheduled) {
|
||||
if (notification.schedule != null) {
|
||||
triggerScheduledNotification(buildNotification, notification)
|
||||
} else {
|
||||
notificationManager.notify(notification.id, buildNotification)
|
||||
@@ -473,7 +473,7 @@ class TimedNotificationPublisher : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
val notificationManager =
|
||||
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
val notification = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
val notification = if (SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
intent.getParcelableExtra(
|
||||
NOTIFICATION_KEY,
|
||||
android.app.Notification::class.java
|
||||
|
||||
Reference in New Issue
Block a user