From cdd387761783cded3e7c83953b73ede47d6109cd Mon Sep 17 00:00:00 2001 From: Jackson Sui Date: Wed, 30 May 2018 17:13:31 -0400 Subject: [PATCH 1/2] Fix: can now use non-zero indexFrom values in listSMS for pagination --- src/android/SMSPlugin.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/android/SMSPlugin.java b/src/android/SMSPlugin.java index 59895f2..3e2dc6f 100644 --- a/src/android/SMSPlugin.java +++ b/src/android/SMSPlugin.java @@ -258,10 +258,9 @@ private PluginResult listSMS(JSONObject filter, CallbackContext callbackContext) matchFilter = true; } if (! matchFilter) continue; - - if (i < indexFrom) continue; - if (i >= indexFrom + maxCount) break; ++i; + if (i < indexFrom) continue; + if (i > indexFrom + maxCount) break; if ((json = this.getJsonFromCursor(cur)) == null) { callbackContext.error("failed to get json from cursor"); From 7e15ba090be6d8d435fdd4786f28382bf4550e0f Mon Sep 17 00:00:00 2001 From: Jackson Sui Date: Wed, 13 Jun 2018 15:52:07 -0400 Subject: [PATCH 2/2] changed line 262 to <= Was previously <, and would get a repeated text message with each page. --- src/android/SMSPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/SMSPlugin.java b/src/android/SMSPlugin.java index 3e2dc6f..4bce3ce 100644 --- a/src/android/SMSPlugin.java +++ b/src/android/SMSPlugin.java @@ -259,7 +259,7 @@ private PluginResult listSMS(JSONObject filter, CallbackContext callbackContext) } if (! matchFilter) continue; ++i; - if (i < indexFrom) continue; + if (i <= indexFrom) continue; if (i > indexFrom + maxCount) break; if ((json = this.getJsonFromCursor(cur)) == null) {