Force embedded website in classic view? (xcode)

Discussion in 'iOS Programming' started by Thelle93, Oct 7, 2012.

  1. Thelle93 macrumors newbie

    Joined:
    Oct 7, 2012
    #1
    Hi!
    Im developing an iphone app in Xcode 4.5 and im wondering if it is possible to force a website url that is embedded with UIWebView to load into classic mode instead of mobile view? (it's a Facebook page that doesn't work well in mobile mode).

    Thanks in advance! :)
     
  2. Thelle93, Oct 7, 2012
    Last edited by a moderator: Oct 8, 2012

    Thelle93 thread starter macrumors newbie

    Joined:
    Oct 7, 2012
    #3
    Thanks it worked! :D

    here's the code:

    Code:
    + (void)initialize {
        NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:@"Classic", @"UserAgent", nil];
        [[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];
    }
     
  3. idelovski macrumors regular

    Joined:
    Sep 11, 2008
    #4
    I was always sure you should do it with "User-Agent" header on the request. It's not that I ever tried to do it, but now I did a google search and found this:

    Stack Overflow - Change User Agent in UIWebView (iPhone SDK)

    I can see several issues, one of them being Note that you need to use @"User-Agent" to read the property, but @"User_Agent" to set it.

    Oh, well.
     

Share This Page