iOS Development: How can I force a UIWebView to load the non-mobile version of Facebook?

前端 未结 2 1646
庸人自扰
庸人自扰 2021-02-13 13:05

I\'m diving into iOS development and when I try to load a specific Facebook Fan Page in a UIWebView, it loads the mobile version of the site, which only loads the wall of the Fa

2条回答
  •  既然无缘
    2021-02-13 14:08

    Do this in viewDidLoad (or somewhere else before loading UIWebView):

    NSDictionary *userAgent = @{ @"UserAgent" : @"Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0" };
    [[NSUserDefaults standardUserDefaults] registerDefaults:userAgent];
    

提交回复
热议问题