Comments (5)
I can't answer why the 100 limit stops things at 100, was that a different
query?
You are mixing the method concept of maxResults and the service property
shouldFetchNextPages. The maxResults controls how many results you can get for
each server request you send. But, shouldFetchNextPages tells the library to
check and see if a query returned an indication that there is another (next)
page of results and if so, follow it merging the results. If you turn on
logging, you'll see the limit happens on each network transaction and then the
library is sending the request for the next page under the hood for you.
Original comment by [email protected]
on 9 May 2012 at 3:39
- Changed state: Invalid
from google-api-objectivec-client.
100 and 200 is the same query with different maxResults.
I think maxResults and shouldFetchNextPages are designed to be used together,
as the doc states:
===
For APIs that provide a nextPageToken or nextStartIndex property, the library
can automatically fetch all pages, and return an object whose items array
includes the items of all pages (up to 25 pages). This can be turned on by
setting the shouldFetchNextPages property of a service or a ticket:
// Turn on automatic page fetches
service.shouldFetchNextPages = YES;
Note, however, that results spread over many pages may take a long time to be
retrieved, as each page fetch will lead to a new http request. The server can
be told to use a larger page size (that is, more items in each page returned)
by fetching a query for the feed with a maxResults value:
// Specify a large page size to reduce the need to fetch additional result pages
GTLQueryTasks *query = [GTLQueryTasks queryForTasklistsList];
query.maxResults = 1000;
ticket = [service executeQuery:query ...
Ideally, maxResults will be large enough that, for typical user data, all
results will be returned in a single page.
===
Also as Greg Robbins said in this
thread(https://groups.google.com/d/msg/google-api-objectivec-client/EcR6bqocyvM/
2WRjYNxelA0J):
===
maxResults is the property for specifying the number of list results, but it's
a poorly-named property; it should really be called maxResultsPerPage. If you
have set the service's property to automatically fetch next pages, it will
fetch a series of pages with maxResults items per page.
===
Let's say with shouldFetchNextPages, query should return 2 pages, where can I
get the response of "the request for the next page the library is sending under
the hood for me"? I suppose the library combines these two pages and returns
them all together to me in my completionHandler, as the doc states "return an
object whose items array includes the items of all pages (up to 25 pages)".
Original comment by [email protected]
on 9 May 2012 at 3:55
from google-api-objectivec-client.
Look at the http log for the request/response. Is the server including a
nextPageToken or nextStartIndex in the response JSON?
Original comment by [email protected]
on 9 May 2012 at 8:06
from google-api-objectivec-client.
Thanks for the hint. After checking the logs, I've identified the problem:
I'm requesting a partial response as follows:
query.fields =
@"updated,items(etag,id,status,created,updated,summary,description,location,star
t,end,recurrence,extendedProperties)";
which does not include nextPageToken and causes the missing of nextPageToken in
the response.
I didn't expect that. In fact, I still think it is odd for Google Calendar to
filter out nextPageToken from the response, because nextPageToken is obviously
not part the "content" that should be controlled by fields.
Original comment by [email protected]
on 9 May 2012 at 8:39
from google-api-objectivec-client.
I'll pass your suggestion on to the API server team. Thanks for letting us know.
Original comment by [email protected]
on 12 May 2012 at 12:40
from google-api-objectivec-client.
Related Issues (20)
- App rejected from App Store: "The app opens a web page in mobile Safari for logging in, then returns the user to the app. The user should be able log in without opening Safari first." HOT 1
- Underlining Connection Timeout(s) and RPC nature of calls HOT 1
- Upload a new file in a trashed folder in Google Drive, the new file should also have trashed attribute(but not) HOT 1
- Cookie Security Concern HOT 4
- GTLService Error returns error in half German - half English HOT 2
- Google Drive Permission Insert Query missing optionals HOT 2
- GTUtilities won't compile on OS X 10.01 HOT 1
- Google Drive's example refers to .xib outside of SVN project HOT 2
- DriveExample won't build on 10.10 HOT 1
- Feature Request: Implement NSURLSession for file Uploads/Downloads (iOS7+) HOT 1
- i can't purchase on my iPhone HOT 3
- Cocoapods support HOT 1
- Where is the Swift version of this!? HOT 3
- Patch for /trunk/Examples/CalendarSample/CalendarSampleAppController.h HOT 1
- [CocoaPods] Duplicate errors with gtm-http-fetcher and GTMHTTPFetcher used at the same time HOT 2
- google-api-objectivec-client + gtm-http-fetcher Duplicate interface definition for class GTMHTTPUploadFetcher HOT 1
- unexpected behavior of GTLQuery as <GTLQueryProtocol> because of typecasting
- When upload large file to Google Drive, upload progress goes backward HOT 3
- Source code shown in browser and got by checkout is different a lot
- Google Cloud Storage sample HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-api-objectivec-client.