Start a new topic

Endpoints in Offline

I'm using KinveyKit 1.26.0. Calling a custom endpoint while offline, the request get queued:



2014-01-28 14:45:05:991 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:217 [INFO (NETWORK)] POST https://baas.kinvey.com/rpc/APPKEY/custom/myEndpoint [KinveyKit id: 'EB76DFC3-147C-4456-9745-F315D2E326B3']



Then retried 5 times:



2014-01-28 14:46:06:251 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:242 [NOTICE (NETWORK)] Retrying request (EB76DFC3-147C-4456-9745-F315D2E326B3). Network error: -1001.



and finally aborted:



2014-01-28 14:50:07:834 /Users/mike/work/ios-library/tags/1.26.0/KinveyKit/KinveyKit/Source/KCSRequest2.m:319 [INFO (NETWORK)] Network Client Error Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x1361fb50 {NSErrorFailingURLStringKey=https://baas.kinvey.com/rpc/APPKEY/custom/myEndpoint, NSErrorFailingURLKey=https://baas.kinvey.com/rpc/APPKEY/custom/myEndpoint, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x1361fd00 "The request timed out."} [KinveyKit id: 'EB76DFC3-147C-4456-9745-F315D2E326B3']



But in the completionBlock:^(id results, NSError *error), results type is (_NSZeroData*). error is correct so no real problem here.


Custom endpoints are not supported in offline.
Oops, that makes sense! Maybe I was too impressed by the debug verbosity of this release.



Using the Reachability class to avoid calling custom endpoints in offline is not enough. On a device in airport mode this works great, but not on the simulator with blocked ports. I'd better use KCSNetworkErrorDomain.
Login or Signup to post a comment