Skip to content

Commit

Permalink
[Health] Fixed empty string pageToken
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmatteo committed Jan 23, 2024
1 parent fc152a6 commit 181a529
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,6 @@ class HealthPlugin(private var channel: MethodChannel? = null) :
var request = ReadRecordsRequest(
recordType = classType,
// Define the maximum amount of data that HealthConnect can return in a single request
pageSize = 5000,
timeRangeFilter = TimeRangeFilter.between(startTime, endTime),
)

Expand All @@ -1708,10 +1707,9 @@ class HealthPlugin(private var channel: MethodChannel? = null) :
records.addAll(response.records)

// Continue making requests and fetching records while there is a page token
while (pageToken != null) {
while (!pageToken.isNullOrEmpty()) {
request = ReadRecordsRequest(
recordType = classType,
pageSize = 5000,
timeRangeFilter = TimeRangeFilter.between(startTime, endTime),
pageToken = pageToken
)
Expand Down

0 comments on commit 181a529

Please sign in to comment.