1. Jump from app to Safari
1nsstring* Stridentifier =@"http://www.ybyb.com";2BOOL isexsit =[[uiapplication sharedapplication] Canopenurl:[nsurl Urlwithstring:stridentifier]];3 if(isexsit) {4NSLog (@"App%@ installed", stridentifier);5 [[uiapplication sharedapplication] Openurl:[nsurl Urlwithstring:stridentifier]];6}
2. Open a phone call from the app
1NSString *phonenum =@"10086";//Phone number2 3UIWebView *Phonecallwebview;4Nsurl *phoneurl = [Nsurl urlwithstring:[nsstring stringWithFormat:@"tel:%@", Phonenum]];5 if( !Phonecallwebview) {6Phonecallwebview = [[UIWebView alloc] Initwithframe:cgrectzero];//This webview is just a background view does not need to add to the page7 8 }9 [Phonecallwebview loadrequest:[nsurlrequest requestwithurl:phoneurl];Ten One[Self.view Addsubview:phonecallwebview];
IOS jump from app to Safari, open phone call from app