Custom HTTP headers UIWebview - ios

I'm developing an application for iOS in Xcode 4.5 but I have a problem with a UIWebView. I want to set a header(BASE64 code) to skip a login part. When I try this, using the NPWebView project the webview always fails with an error which looks like this:
Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0x6ace650 {NSErrorFailingURLKey="MY URL", NSErrorFailingURLStringKey="MY URL"}
I hope someone can help me!

I don't know from your description exactly what's going on, but -999 usually comes from the request being cancelled, in my experience.
(See https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/Reference/reference.html#//apple_ref/doc/c_ref/NSURLErrorCancelled)

Related

Network debugging specific to network carriage

I have an iPhone application in which I have a request which works fine on wifi and with all network carriages but one carriage. On this carriage, if I use ASIHttpRequest, it gives me the below error:
ASIHTTPRequest request_didFail: Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0xd54e2f0 {NSUnderlyingError=0xd502de0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)", NSLocalizedDescription=A connection failure occurred}
If I use AFNetworking it returns below error:
NSLocalizedDescription = "Could not connect to the server.";
NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1004 \"Could not connect to the server.\" UserInfo=0xdc98630 {NSErrorFailingURLKey=https://sitename.com, NSErrorFailingURLStringKey=https://sitename.com, NSLocalizedDescription=Could not connect to the server.}";
First of all, what could be the reason of this error assuming it only happens for a specific carrier? Second, as the request works with everything but this carriage, it seems hard to debug, so how can I debug it to find the exact problem?
Thanks
It turned out that the problem was with this specific telco. Without changing the code, it started to work again after some time.
For the answer to this question, I can say that the reason could be about some proxy thing that is made by the telco and we tried to debug it by applying different proxy tests.

Could not determine current country code: Error Domain=GEOErrorDomain Code=-2 "The operation couldn’t be completed. (GEOErrorDomain error -2.)"

I am getting this error code when using 'MKMapView' on the iPhone 4:
Could not determine current country code: Error Domain=GEOErrorDomain Code=-2 "The operation couldn’t be completed. (GEOErrorDomain error -2.)"
The map loads fine with coordinates etc, but this gets logged.
Any ideas what is causing it?
I got this today on my iPad4-Wifi.
Reading more of the message, it stated that it had o internet connection.
Sure enough, the iPad lost connection to the wifi for some reason.
I reselected our wifi network, retried the test and it worked.

(NSURLErrorDomain error -999.)

I have found this error:
Error - Error Domain=NSURLErrorDomain Code=-999
The operation couldn’t be completed. (NSURLErrorDomain error -999.)
During load youtube link on my UIWebView first time.
Any idea why this happens?
-999 error code means NSURLErrorCancelled.
This happens when the past request is cancelled.
If it works without any issues except that, no problem :)
See: Foundation Constants Reference

Dropbox Error DropboxSDK: error making request to /1/files/sandbox

I have integrated Dropbox core api. I am able to upload data without any error but when i am downloading all contents present in my app folder its showing the following error :
DropboxSDK: error making request to
/1/files/sandbox/Mov_1373955204.txt - Error Domain=NSURLErrorDomain
Code=-1001 "The operation couldn’t be completed. (NSURLErrorDomain
error -1001.)" UserInfo=0x9c0ec30 {path=/Mov_1373955204.txt,
destinationPath=/Users/mac26/Library/Application Support/iPhone
Simulator/6.0/Applications/800506EB-02E2-40F6-8B2B-F8B296760795/Library/Caches/DropBox/Mov_1373955204.txt}
I have searched alot have also tried to change the request timeout from 20 to 200 but still same issue is coming.
Any help will be appreciated thanks.

Facebook iOS SDK returns error "com.facebook.sdk error 4"

Today we started to get the following error when using the Facebook SDK for iOS to try and query some pages streams:
Error Domain=com.facebook.sdk Code=4 "The operation couldn’t be completed. (com.facebook.sdk error 4.)" UserInfo=0xb8606d0 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ErrorSessionKey=
This code used to work for months. Anyone knows what error code 4 means???
See this page on how to properly handle errors:
https://developers.facebook.com/docs/reference/api/errors/
Code 4 looks like you're being throttled because you're making too many requests.

Resources