guidelines for opening safari from an iPhone app

假如想象 提交于 2019-12-24 00:24:57

问题


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


回答1:


-(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>



回答2:


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



来源:https://stackoverflow.com/questions/12317595/guidelines-for-opening-safari-from-an-iphone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!