I have a remote hybrid app that uses a community login page. If you login successfully, it works fine. If you get your user/password wrong, sometimes you get the login page again, but sometimes you get a black screen with a popup message "The URL can’t be shown".
The xcode console shows more detail:
ERROR|SFAuthenticationManager|Error during authentication: Error Domain=WebKitErrorDomain Code=101 "The URL can’t be shown" UserInfo=0x7fa36523a060 {NSErrorFailingURLStringKey=gap://ready, NSLocalizedDescription=The URL can’t be shown, NSErrorFailingURLKey=gap://ready}
I haven't figured out why that happens, and now it's gotten worse- instead of showing the error, the app crashes. I believe the change is that it's running on iOS 8.3, although I don't have an 8.2 device available currently to test with.
I've determined that the crash is happening in SFOAuthCoordinator
; it looks like SFOAuthCoordinator
, acting as a delegate for the login web view, is receiving the message webView:didFailLoadWithError:
and calling notifyDelegateOfFailure:authInfo:
, which is calling self.authInfo = nil;
, but at this point the object has been released (EXC_BAD_ACCESS
in objc_msgSend
). In the XCode console, the crash happens immediately after the above "Url can't be shown" error, so I suspect that fixing that would eliminate the crash. But I have no idea what causes this... the login page is just a modified version of the default SiteLogin page, and the login method is the default:
global PageReference login() {
String startUrl = System.currentPageReference().getParameters().get('startURL');
return Site.login(username, password, startUrl);
}