0

In my app, I am trying to display Facebook fan page wall (eg.https://m.facebook.com/DonaldDuck) in the UIWebView. But white screen gets displayed and getting error as:

Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “m.facebook.com” which could put your confidential information at risk."

I have found the same issue as stackoverflow1.

I have tried this solution.

Also tried below links to display Facebook fan page wall.

http://m.facebook.com/DonaldDuck?v=wall
http://m.facebook.com/DonaldDuck?v=feed

Code:

NSURL *url = [NSURL URLWithString:FACEBOOK_LINK];
NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url];
[requestObj setValue:@" Safari/537.1" forHTTPHeaderField:@"User_Agent"]; // Line 1
[fbWebView setDelegate:self];
[fbWebView loadRequest:requestObj];

Above Line 1, If I use then I am able to see wall page.But this is private api and i have to submit this app on apple store. So, i guess this will not work. :(

Any idea how to resolve this issue on iPad? (It works with iPhone UIWebView)

Community
  • 1
  • 1
Kirti Nikam
  • 2,166
  • 2
  • 22
  • 43
  • take a look:-http://stackoverflow.com/questions/12347410/iphone-secure-restfull-server-the-certificate-for-this-server-is-invalid – Nitin Gohel Jul 16 '13 at 14:02
  • Hi,Nitin. Thanks for answering. I already found this solution but it will helpful for developing purpose. If I use this allowsAnyHTTPSCertificateForHost method and submit it on apple store then apple will reject my app because this is a private api. – Kirti Nikam Jul 16 '13 at 14:07

0 Answers0