cordova - PhoneGap iOS oAuth redirect failing (NSURLErrorDomain error -999.) -
meteorjs: https://github.com/zeroasterisk/presenteract
phonegap: https://github.com/zeroasterisk/presenteract-phonegap-ios
- i running meteorjs application inside phonegap 2.7 on ios.
- the meteorjs application loaded via external url, setup in
config.xml
<content src="http://presenteract.meteor.com" />
- i have no problems oauth within browser
- the
access
config setup full wildcard<access origin="*" />
- the application works well, identical browser version of it....
but when attempt oauth within phonegap, end following error:
failed load webpage error: operation couldn’t completed. (nsurlerrordomain error -999.)
(note: oauth attempts google, facebook, , twitter same. loads external site, login proceeds normal, , upon redirect application's main url)
i have looked through other stackoverflow reports , done googeling... useful 1 found is:
facebook dialog failed error: operation couldn’t completed. (nsurlerrordomain error -999.) & related: nsurlerrordomain error -999 - links failing in ios
this seems promising, don't know how translate solution phonegap...
i found following stub, in <projectname>/classes/mainviewcontroller.m
, have played bit, no solution yet....
- (void) webview:(uiwebview*)thewebview didfailloadwitherror:(nserror*)error { /* (this log console, doesn't tell me different) * still: thewebview webview didfailloadwitherror:nsurlerrordomain -999 */ nslog(@"thewebview webview didfailloadwitherror:%@ %d",error.domain,error.code); /* (this commented out, didn't seem me) */ if ([error.domain isequaltostring:@"nsurlerrordomain"] && error.code == -999) { nslog(@"thewebview webview caught error=-999... returning void doesn't force page reload/continue:%@ %d",error.domain,error.code); return; } /* (this here, part of phonegap) */ return [super webview:thewebview didfailloadwitherror:error]; }
i second "caught error=-999" log message, end in white screen on app still.
- perhaps there's setting somewhere allow redirect-back application's url?
- perhaps need force reload app's main page?
- perhaps need more elegant way of catching error doesn't stop loading?
- perhaps need more information causing failure in first place?
i hit same error when upgraded cordova (phonegap) 2.2 2.7.
looking @ description, cannot readily tell if same problem. but, thought sharing solution / workaround might help.
the problem hit cordova 2.7 didn't handle client side redirect during startup correctly.
i tried play around mainviewcontroller.m
, didn't believe problem can worked around there.
my solution modified cordovalib/classes/cdvwebviewdelegate.m
handle redirect case.
here pull-request:
Comments
Post a Comment