From 204d107247cbad80cca01e50a5b88c24f7e923fa Mon Sep 17 00:00:00 2001 From: Franco Zalamena Date: Tue, 7 Apr 2026 15:48:00 +0100 Subject: [PATCH] Add clearPayloadData() method to IterableApi Allow users to reset/clear the notification payload data returned by getPayloadData() after they have finished processing it. Fixes #199. Co-Authored-By: Claude Opus 4.6 --- .../main/java/com/iterable/iterableapi/IterableApi.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java b/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java index 3182ddf43..bcc32d21e 100644 --- a/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java +++ b/iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java @@ -1245,6 +1245,15 @@ public Bundle getPayloadData() { return _payloadData; } + /** + * Resets the notification payload data by setting it to null. + * Call this method after you have finished processing the notification payload + * to prevent stale data from being returned by {@link #getPayloadData()}. + */ + public void clearPayloadData() { + _payloadData = null; + } + public void setDeviceAttribute(String key, String value) { if (key == null || value == null) { IterableLogger.e(TAG, "setDeviceAttribute: key and value must not be null");