Skip to content

Commit 0ec5560

Browse files
committed
feat: update onDismissListener, dismiss if flag 'ck_persist' is present
1 parent 53d24c0 commit 0ec5560

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/src/method_channel/web_callkit_method_channel.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,15 @@ class MethodChannelWebCallkit extends WebCallkitPlatform {
8383
void _onDismissListener(CKCallResult result) {
8484
printDebug("Dismissed notification: ${result.uuid}", tag: NotificationManager.tag);
8585
final persist = result.containsFlag(NotificationManager.CK_EXTRA_PERSIST);
86-
if (!persist) {
87-
_dismissNotification(result.uuid);
86+
if (result.uuid != null) {
87+
final uuid = result.uuid!;
88+
if (!persist) {
89+
_dismissNotification(uuid);
90+
} else {
91+
_onDismissedListener?.call(uuid, ActionSource.notification);
92+
}
8893
} else {
89-
_onDismissedListener?.call(result.uuid, ActionSource.notification);
94+
// case when uuid is null, e.g. group display
9095
}
9196
}
9297

0 commit comments

Comments
 (0)