MeteorJS(NSURLErrorDomain錯誤-999):https://github.com/zeroasterisk/Presenteract的PhoneGap的iOS OAuth的重定向失敗
的PhoneGap:https://github.com/zeroasterisk/Presenteract-PhoneGap-ios
- 我在iOS上運行裏面的PhoneGap 2.7 MeteorJS應用。
- 的MeteorJS應用經由外部URL,設置裝入3210作爲
<content src="http://presenteract.meteor.com" />
- 我有OAUTH沒有問題從一個瀏覽器內
- 的
access
配置是設置一個完整的通配符<access origin="*" />
- 中的應用工作得非常好,等同於它的瀏覽器版本....
但是,當我從內PhoneGap的嘗試OAuth的,我結束了以下錯誤:
Failed to load webpage with error: The operation couldn’t be completed.
(NSURLErrorDomain error -999.)
(注意:來自Google,Facebook和Twitter的oAuth嘗試都是一樣的。加載外部網站,登錄正常進行,並在重定向回我的應用程序的主要URL)
我已經通過其他StackOverflow的報告,看了看,做了一些googeling ...最有用的一個,我發現是:
Facebook dialog failed with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.) &相關:NSURLErrorDomain error -999 - links failing in iOS
這看起來非常有前途,但我不知道如何解決這個PhoneGap的成...翻譯
我發現下面的存根,在<projectname>/Classes/MainViewController.m
和我與它起到了一點,但沒有解決辦法尚未....
- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
{
/* (this does log to the console, but doesn't tell me anything different)
* still: theWebView webView didFailLoadWithError:NSURLErrorDomain -999
*/
NSLog(@"theWebView webView didFailLoadWithError:%@ %d",error.domain,error.code);
/* (this is commented out, it didn't seem to do anything for me) */
if ([error.domain isEqualToString:@"NSURLErrorDomain"] && error.code == -999) {
NSLog(@"theWebView webView caught the error=-999... but returning void doesn't force the page to reload/continue:%@ %d",error.domain,error.code);
return;
}
/* (this was already here, part of PhoneGap) */
return [super webView:theWebView didFailLoadWithError:error];
}
我得到的第二個「抓住了錯誤= -999」日誌消息,但我仍然在應用程序的白色屏幕上結束。
- 也許有一些設置允許重定向到我的應用程序的URL?
- 也許我需要強制它重新加載我的應用程序的主頁?
- 也許我需要一些更優雅的捕捉錯誤的方式,以便它不停止加載?
- 也許我需要更多關於什麼導致失敗的信息?
真棒 - 感謝分享,我會盡快爲我能檢討! (我玩弄「降級」PhoneGap的想法直到解決,因爲我也有一個不同的插件問題) – zeroasterisk 2013-05-29 14:09:46
這個bug修復了Phonegap 3.0的bug。 – 2013-08-11 00:27:59