Hi I am working with AWS Mobile SDK for iOS.
I am tracking some data with KinesisEventRecorder.
When the device has not connection I get this error:
AWSiOSSDK v2.4.2 [Error] AWSURLSessionManager.m line:211 | -[AWSURLSessionManager URLSession:task:didCompleteWithError:] | Session task failed with error: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline.
I know that this framework continue to keep data also without connection, but when the connection come back it seems send nothing.
Is there some properties to setting?
Related
We are testing apps for IPV6 compatibility in both IPV6 (nat64 network) only and IPV4 only networks. We had been using the GCDAsyncSocket network library to make socket connections for our app to send and receive data over it.
1. When we test our iOS app (using the old GCDAsyncSocket code that we had downloaded in 2014) connecting to IPV6 only (nat-64) network as per Apple's guides here, the socket connection gets established successfully as soon as we log into the app, but within a few seconds (probably 20-30seconds , sometimes in a couple of mins), the -(void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err gets called disconnecting the socket.
This happens only once every time we log out and log in to our app. As soon as we login, socket gets established, then suddenly gets disconnected throwing the below error:
2016-12-17 09:11:10.650437 atCommand Enterprise[288:13780] LOG: Socket disconnect
2016-12-17 09:11:11.979232 atCommand Enterprise[288:13780] LOG: -
[MLAPIControl socketDidDisconnect:withError:] -> 175
Printing description of err:
Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected"
UserInfo={_kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}
Printing description of ((__NSCFDictionary *)0x0000000170470880):
{
"_kCFStreamErrorCodeKey" = 57;
"_kCFStreamErrorDomainKey" = 1;
}
Printing description of sock:
<GCDAsyncSocket: 0x101737d70>
2016-12-17 09:11:55.853540 atCommand Enterprise[288:13780] LOG: Error
Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected" UserInfo=
{_kCFStreamErrorCodeKey=57, _kCFStreamErrorDomainKey=1}
2016-12-17 09:11:55.858775 atCommand Enterprise[288:13780] LOG: -
[MLAPIControl socketDidDisconnect:withError:] :
2. The exactly same issue of socket disconnection, after initial successful connection, happens even when i downloaded the latest (Latest commit 8ce941d 25 days ago) GCDAsyncSocket library code.
Any help is greatly appreciated.
Thank You.
Generally, while performing GET or POST calls in iOS using dataTaskWithRequest or sendAsynchronousRequest we use to face network related errors with error codes like,
NSURLErrorNotConnectedToInternet = -1009
NSURLErrorCannotConnectToHost = -1004
NSURLErrorTimedOut = -1001
In my case i'm disconnecting the internet and performing service calls. So, the expected error code is "NSURLErrorNotConnectedToInternet = -1009". But, its throwing "NSURLErrorCannotConnectToHost = -1004" like below,
Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the
server." UserInfo=0x1700f0e00 {NSUnderlyingError=0x170255e70 "The
operation couldn’t be completed. (kCFErrorDomainCFNetwork error
-1004.)", NSErrorFailingURLStringKey=https://example.com/reg,
NSErrorFailingURLKey=https://example.com/reg, _kCFStreamErrorDomainKey=1,
_kCFStreamErrorCodeKey=51, NSLocalizedDescription=Could not connect to the server.}
So, how to get the exact error status while using dataTaskWithRequest or sendAsynchronousRequest.
As a rule, IIRC, the OS sends "not connected to Internet" only in two situations:
The network is determined to be nonfunctional after:
One or more URL requests fail and
The OS tries to probe a well-known captive-portal-detection URL and
That request also fails
No interface has an IP address
Including any connected VPNs
Excluding loopback interface
Up until the system reaches that state, the failures you see will be "cannot connect to host", because that's all the OS knows for certain.
As a rule, your app should interpret these in the same way — by using reachability to determine when to try again, then trying again when reachability changes.
I tried to connect IBM AppCenter 6.2.0.01.20141013-1735 on iOS 6/8.1 (enabled SSL)
After I clicked Login btn, app showed Loading view forever (no fail/success/timeout response).
I checked device log:
IBMAppCenter[1385:29127] [Appcenter][CordovaPlugin][INFO]: Query login
user name:admin server:https://example.net:9443/applicationcenter
Then I disabled network, Application hided loading and showed "no network" message.
I checked log again then saw this:
2015-03-31 10:07:13.191 IBMAppCenter[1385:29127]
[Appcenter][CordovaPlugin][ERROR]: Query login admin on
https://example.net:9443/applicationcenter/FAILED
2015-03-31 10:07:13.191 IBMAppCenter[1385:29127] [Appcenter][General][ERROR]:
Error handler, http status: null "Error Domain=NSURLErrorDomain
Code=-1009 "The Internet connection appears to be offline."
UserInfo=0x7c8c2830
{NSErrorFailingURLStringKey=https://example.net:9443/applicationcenter/service/auth,
_kCFStreamErrorCodeKey=57, NSErrorFailingURLKey=https://example.net:9443/applicationcenter/service/auth,
NSLocalizedDescription=The Internet connection appears to be offline.,
_kCFStreamErrorDomainKey=1, NSUnderlyingError=0x7c8c0890 "The Internet connection appears to be offline."}"
2015-03-31 10:07:13.192 IBMAppCenter[1385:29127] [Appcenter][General][ERROR]: Error handler, displayed message:
"Connection failed. Check your connection details (The Internet
connection appears to be offline.)."
maybe it was connecting to /service/auth...
I tried on Android, it works fine.
Also tried with no-ssl, it works fine on both Android/iOS.
my SSL was verified by GoDaddy G2.
I am stuck over here and could not find any way out.
This may be related to the way you have installed the GoDaddy-issued certificate.
First,
Make sure it upholds to the required standards for using a certificate: IBM AppCenter 6.2.0 + SSL on iOS - shows loading view forever when connect to Server (no response fail/success/timeout))
Second,
Verify you have properly installed it. That is, make sure you did not install it via the Mobile Safari browser, as it won't be available to apps that way (see above link).
i'm trying to use google maps in my app, i followed there main steps here: https://developers.google.com/maps/documentation/ios/start#getting_the_google_maps_sdk_for_ios
the sceene was loaded, but the map is empty, and i got this error :
ClientParametersRequest failed, 0 attempts remaining (0 vs 6). Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo=0x7fd8ab5e9680 {NSUnderlyingError=0x7fd8b0201c40 "The network connection was lost.", NSErrorFailingURLStringKey=https://clients4.google.com/glm/mmap, NSErrorFailingURLKey=https://clients4.google.com/glm/mmap, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=57, NSLocalizedDescription=The network connection was lost.
anyone knows what's the problem ?
Try reseting the iOS simulator:
iOS Simulator -> Reset Content and Settings
I'm using Parse.com SDK.
my internet connection is OK and reset the emulator not help.
And for some reason, from yesterday i see this message every time the app load:
2014-11-25 10:00:32.275 myApp[6551:952636] Error: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo=0x78f3b6f0 {NSErrorFailingURLStringKey=https://api.parse.com/2/client_events, _kCFStreamErrorCodeKey=57, NSErrorFailingURLKey=https://api.parse.com/2/client_events, NSLocalizedDescription=The network connection was lost., _kCFStreamErrorDomainKey=1, NSUnderlyingError=0x78f3ad40 "The network connection was lost."} (Code: 100, Version: 1.4.0)
2014-11-25 10:00:32.275 myApp[6551:952637] Attempt at runEventually command timed out. Waiting 600.000000 seconds. 5 retries remaining.
I suggest you to first subscribe parse status mail list from here.
Check your api number.
Reset simulator and close open xcode.
If you reset simulator, problem could be from api keys or parse.