From 45287e8f122ab9bb47c8a9462c05072f7c2eefa1 Mon Sep 17 00:00:00 2001 From: emawby Date: Mon, 23 Oct 2023 10:01:26 -0700 Subject: [PATCH] Listen to clearTriggers on android --- .../java/com/onesignal/flutter/OneSignalInAppMessages.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/src/main/java/com/onesignal/flutter/OneSignalInAppMessages.java b/android/src/main/java/com/onesignal/flutter/OneSignalInAppMessages.java index 4d414aad..92467a33 100644 --- a/android/src/main/java/com/onesignal/flutter/OneSignalInAppMessages.java +++ b/android/src/main/java/com/onesignal/flutter/OneSignalInAppMessages.java @@ -44,6 +44,8 @@ else if (call.method.contentEquals("OneSignal#removeTrigger")) this.removeTrigger(call, result); else if (call.method.contentEquals("OneSignal#removeTriggers")) this.removeTriggers(call, result); + else if (call.method.contentEquals("OneSignal#clearTriggers")) + this.clearTriggers(call, result); else if (call.method.contentEquals("OneSignal#arePaused")) replySuccess(result, OneSignal.getInAppMessages().getPaused()); else if (call.method.contentEquals("OneSignal#paused")) @@ -81,6 +83,11 @@ private void removeTriggers(MethodCall call, Result result) { } } + private void clearTriggers(MethodCall call, Result result) { + OneSignal.getInAppMessages().clearTriggers(); + replySuccess(result, null); + } + private void paused(MethodCall call, Result result) { OneSignal.getInAppMessages().setPaused((boolean) call.arguments); replySuccess(result, null);