2

Facebook comment part of webview keep loading and it never finish on device. But, it works just fine on simulator. Does somebody have an idea to fix this? Thanks in advance!

enter image description here

This is the code to add UIWebview on UIViewController.

NSString *address = @"http://techcrunch.com/2012/03/10/entrepreneurs-are-difficult-at-best-and-abrasive-at-worst-get-over-it/?grcc=33333Z98";

//make webview frame
webView_                    = [[UIWebView alloc] init];
webView_.delegate           = self;
webView_.frame              = self.view.bounds;
webView_.autoresizingMask   = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
webView_.scalesPageToFit    = YES;
[self.view addSubview:webView_];

//load page on webview
NSURL *myURL                = [NSURL URLWithString:address];
NSURLRequest *myURLReq      = [NSURLRequest requestWithURL:myURL];
[webView_ loadRequest:myURLReq];   

This is the error message on - (void)webView:(UIWebView *)webView didFailLoadWithError:

Error Domain=NSURLErrorDomain Code=-999 "The operation couldn't be completed. (NSURLErrorDomain error -999.)"

Update

I tested it with a clean uiwebview, since the previous build had Sharekit plugin, but the error still exist with a new build. Also, this link is related, First dialog after authenticating fails immediately and closes dialog

Community
  • 1
  • 1
Umeumeume
  • 1,952
  • 3
  • 21
  • 40
  • did you try to implement the delegate functions for the UIWebView (webViewDidFinishLoad & webView didFailLoadWithError) to see if there is a problem or not with your request ? – Malek_Jundi Mar 11 '12 at 01:58
  • Sorry to mention that, this is the error code. I keep getting this error on the techcrunch page. Error Domain=NSURLErrorDomain Code=-999 "The operation couldn't be completed. (NSURLErrorDomain error -999.)" – Umeumeume Mar 11 '12 at 02:17
  • 1
    maybe [this](https://github.com/ShareKit/ShareKit/issues/56) can help u – Malek_Jundi Mar 11 '12 at 02:33
  • It just shows how to handle the error. I am handling the error to stop loading programmatically at the moment like that. But, I want to show the facebook comment pages on UIWebview properly. But, thank you for your inputs, I will look into it more. – Umeumeume Mar 11 '12 at 04:32
  • My answer might refer as well: http://stackoverflow.com/questions/10209267/ios-facebook-comments-plugin-mobile-keeps-reloading/11759966#11759966 – blebleble Aug 01 '12 at 13:12

1 Answers1

1

FYI, I opened a bug recently on this. Facebook hasn't really responded and oddly classified it as a "wishlist" item: https://developers.facebook.com/bugs/373249496041875?browse=search_4fa8cf425c5aa8d66140047

TMC
  • 8,088
  • 12
  • 53
  • 72