ページングで Google Cloud Endpoints を使用する方法を理解しようとしています。10件の結果しか返ってきません。プロパティ shouldFetchNextItems を YES に設定しました。また、クエリ オブジェクトには nextToken または maxResults プロパティがありません。pageToken を持つ GTLQueryCollectionProtocol がありますが、それがどこで使用されているかわかりません。
static GTLServiceOwnit *service = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
service = [[GTLServiceOwnit alloc] init];
service.retryEnabled = YES;
service.shouldFetchNextPages = YES;
});
NSError *error;
NSSortDescriptor *sortDescriptor1 = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES];
GTLQueryOwnit *query = [GTLQueryOwnit queryForBrandList];
[service executeQuery:query completionHandler:^(GTLServiceTicket *ticket, GTLOwnitBrandCollection *object, NSError *clouderror) {
NSLog(@"counts: %d", [[object items] count]);
...
編集:これがPythonでの私のバックエンドです:
class Brand(EndpointsModel):
name = ndb.StringProperty(required=True)
@Brand.query_method(path='brand',
http_method='GET',
name='brand.list')
def brand_list(self, query):
"""Exposes an API endpoint to query for brands for the current user"""
return query.order(Brand.name)
ありがとう、