+ Start a Discussion
mirunmirun 

Redirecting to error.html in iOS salesforce Sdk

Hi

We are developing a hybrid app with Salesforce iOS SDK with offline support using Smartstore. When app is offline we want UIwebview to load an error page which is at the client side instead of throwing the below error at the console. ERROR|SFHybridViewController|Error while attempting to load web page: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x99c4530 {NSErrorFailingURLStringKey=http://, NSErrorFailingURLKey=http://, NSLocalizedDescription=The Internet connection appears to be offline., NSUnderlyingError=0x9d86970 "The Internet connection appears to be offline."} Failed to load webpage with error: The Internet connection appears to be offline.

Best Answer chosen by Admin (Salesforce Developers) 
Kevin HawkinsKevin Hawkins
We don't currently have the means to control the error messaging when OAuth fails at startup, which is where the error is ultimately coming from. We hope to bring more configurability to the developer in this area, in a future release.

All Answers

jhersh0jhersh0

You're trying to load an invalid URL -- from your error message, it looks like you passed a malformed URL: "http://"

 

Instead you should have your error page stored locally, then pass its HTML directly to the UIWebView in question.

Kevin HawkinsKevin Hawkins
We don't currently have the means to control the error messaging when OAuth fails at startup, which is where the error is ultimately coming from. We hope to bring more configurability to the developer in this area, in a future release.
This was selected as the best answer