kontaktio / kontakt-ios-sdk

This SDK makes it easy for you to configure, monitor, and securely update Kontakt.io Beacons through our Kontakt.io API.
http://developer.kontakt.io
Other
48 stars 9 forks source link

Get more results #43

Closed zhoupIT closed 7 years ago

zhoupIT commented 7 years ago

Hello there!

[[KTKCloudClient sharedInstance] getObjects:[KTKDevice class] parameters:@{@"uniqueId":@"b05C6"} completion:^(KTKKontaktResponse * _Nullable response, NSError * _Nullable error) {
        NSLog(@"%@ ",response);   
    }];

I have used the method getObjects to get my gateway devices,and your tips tell me I can get more results when use the following example,but i found the value of response.nextResultsURL is nil.It will cause an error "unsupported URL".

// Call next result set ..
        [[KTKCloudClient sharedInstance] GET:response.nextResultsURL completion:^(KTKKontaktResponse * _Nullable response, NSError * _Nullable error) {
            // ... more results ?
        }];
stoprocent commented 7 years ago

Hi @zhoupIT

nextResultsURL will contain a link to more results but only if there are more results. Otherwise is nil.

If you are running query like you posted above with parameters: @{@"uniqueId":@"b05C6"} you are asking for one particular beacon so there will be no more results but just this one device.