Launch an app from within another (iPhone)

Is it possible to launch any arbitrary iPhone application from within another app?, For example in my application if I want the user to push a button and launch right into the Phone app (close the current app, open the Phone app).

would this be possible? I know this can be done for making phone calls with the tel URL link, but I want to instead just have the Phone app launch without dialing any specific number.


As Kevin points out, URL Schemes are the only way to communicate between apps. So, no, it's not possible to launch arbitrary apps.

But, it is possible to launch any app that registers a URL Scheme, whether its Apple's, yours, or another developer's. The docs are here:

Communicating with Other Applications

As for launching the phone, looks like your tel: link needs to have least three digits before the phone will launch. So you can't just drop into the app w/o dialing a number.


I found that it's easy to write an app that can open another app.

Let's assume that we have two apps called FirstApp and SecondApp . When we open the FirstApp, we want to be able to open the SecondApp by clicking a button. The solution to do this is:

  • In SecondApp

    Go to the plist file of SecondApp and you need to add a URL Schemes with a string iOSDevTips (of course you can write another string.it's up to you).

  • 在这里输入图像描述

    2 . In FirstApp

    Create a button with the below action:

    - (void)buttonPressed:(UIButton *)button
    {
      NSString *customURL = @"iOSDevTips://";
    
      if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]])
      {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]];
      }
      else
      {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"URL error"
                                  message:[NSString stringWithFormat:@"No custom URL defined for %@", customURL]
                                  delegate:self cancelButtonTitle:@"Ok" 
                                  otherButtonTitles:nil];
        [alert show];
      }
    
    }
    

    That's it. Now when you can click the button in the FirstApp it should open the SecondApp.


    The lee answer is absolutely correct for iOS prior to 8.

    In iOS 9 you must whitelist any URL schemes your App wants to query in Info.plist under the LSApplicationQueriesSchemes key (an array of strings):

    链接地址: http://www.djcxy.com/p/95798.html

    上一篇: iPhone上的UIView和UILabels上的渐变

    下一篇: 从另一个(iPhone)启动应用程序