2

Are there any usability guidelines around opening a website in safari from an iPhone app?

Example: I have a button in my app, that when tapped takes the user to a website in safari - this closes my app and opens safari.

To me, it seams kinda crappy to do this without warning the user that they are about to exit the app and open safari.

Are there any user guidelines that state how this should be handled? I.e. should you prompt the user and let them know?

I haven't been able to find an official guideline

vedran
  • 1,145
  • 2
  • 13
  • 19

2 Answers2

4
-(void)openSafari
{
   UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"test"
                       message:@"this will open safari, you sure?" 
                       delegate:self cancelButtonTitle:@"no" 
                       otherButtonTitles:@"yes", nil];
              [alert show];
}


- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSString *title = [alertView buttonTitleAtIndex:buttonIndex];

    if([title isEqualToString:@"yes"]){
    [[UIApplication sharedApplication] openURL:
    [NSURL URLWithString:@"http://www.google.com"]];
  }
}

in your header file.

 @class YourClass : SuperClass<UIAlertViewDelegate>
janusfidel
  • 8,036
  • 4
  • 30
  • 53
  • thanks @janusfidel. I know how to do it, I was just wandering if there are any guidelines on whether you need to do this – vedran Sep 07 '12 at 12:17
  • @vedran IMHO what is important is, the user has an idea that the app will open the safari. it is for a great user experience, make the next event predictable. I dont know any documented guidelines about it :) Im sorry. – janusfidel Sep 07 '12 at 12:37
  • thanks @janusfidel - I feel the same - should tell the user what is going to happen – vedran Sep 07 '12 at 13:08
1

It's better if you load the web on a UIWebView instead opening safari (as twitter, facebook and many other apps do), because the user doesn't leave your app

jcesarmobile
  • 51,328
  • 11
  • 132
  • 176