Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PBRequester failed with Error in iOS app

I am facing some strange problem in my iOS app. When my app is open and the user presses the sleep/wake button, app calls

applicationWillResignActive
applicationDidEnterBackground

When user right swipe to unlock the screen , app calls

applicationWillEnterForeground
applicationDidBecomeActive

After that, it prints the following error in console:

PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x1cdfbc00 {NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0x1cddca10 "A server with the specified hostname could not be found."}

I know this error is stating that the specified host name was not found. But which host name? Is it https://gsp10-ssl.apple.com/use or the hostname which I am using for web services?

How can I debug this error, and identify its origin?

like image 706
iOSAppDev Avatar asked Dec 19 '12 04:12

iOSAppDev


2 Answers

I had the same issue. I integrated the parse.com framework into my app.

- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
  // Store the deviceToken in the current installation and save it to Parse.
  PFInstallation *currentInstallation = [PFInstallation currentInstallation];
  [currentInstallation setDeviceTokenFromData:deviceToken];
  [currentInstallation saveInBackground];
}

- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
  [PFPush handlePush:userInfo];
}

After I moved this two code block from the AppDelegate into my main ViewController file the error message was gone... Maybe it helps you...

like image 158
Patrick Riemer Avatar answered Nov 14 '22 21:11

Patrick Riemer


I had similar error. I have a application with MKMapView. While I was testing application I intentionally disconnect device Wifi to see app behaviour, in debug i see error:

PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=0x18e4fac0 {NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorCodeKey=-9806, NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, _kCFStreamErrorDomainKey=3, NSUnderlyingError=0x18e51690 "An SSL error has occurred and a secure connection to the server cannot be made.", NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use}

At this point device was trying to connect 3G because device had "Mobile Data" enabled. I also had no credit for a 3G connection. I suppose that was the source of specifically this error (no credit for 3G), because when I disabled "Mobile Data" I was, already, receiving another error, also from PBRequester

PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x188e4b00 {NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, _kCFStreamErrorCodeKey=8, NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use, NSLocalizedDescription=The Internet connection appears to be offline., _kCFStreamErrorDomainKey=12, NSUnderlyingError=0x18d78410 "The Internet connection appears to be offline."}

I tend to blame MKMapView object for raising these errors, as it needs continuously an active connection to retrieve map layers/titles. While application have other active screens ( with no MKMapView), there is no error raised.

like image 2
slava Avatar answered Nov 14 '22 19:11

slava