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)