diff --git a/test-apps/daily-notification-test/android/app/src/main/java/com/timesafari/dailynotification/test/TestNativeFetcher.java b/test-apps/daily-notification-test/android/app/src/main/java/com/timesafari/dailynotification/test/TestNativeFetcher.java index c9ba55b..8de562b 100644 --- a/test-apps/daily-notification-test/android/app/src/main/java/com/timesafari/dailynotification/test/TestNativeFetcher.java +++ b/test-apps/daily-notification-test/android/app/src/main/java/com/timesafari/dailynotification/test/TestNativeFetcher.java @@ -178,7 +178,14 @@ public class TestNativeFetcher implements NativeNotificationContentFetcher { // Build request body Map requestBody = new HashMap<>(); requestBody.put("planIds", getStarredPlanIds()); - requestBody.put("afterId", getLastAcknowledgedJwtId()); + + // afterId is required by the API endpoint + // Use "0" for first request (no previous data), or stored jwtId for subsequent requests + String afterId = getLastAcknowledgedJwtId(); + if (afterId == null || afterId.isEmpty()) { + afterId = "0"; // First request - start from beginning + } + requestBody.put("afterId", afterId); String jsonBody = gson.toJson(requestBody); Log.d(TAG, "TestNativeFetcher: Request body: " + jsonBody);