0

Can I invoke another installed applications within my application? Suppose I have installed AngryBirds, I have to invoke that application by tapping a button from my application. Is it possible?

rakeshNS
  • 4,227
  • 4
  • 28
  • 42

4 Answers4

1

You can do it if the application in question has a defined protocol, in example if you want to call a number via skype you can perform an action like

NSString *contactName = @"user123";
NSURL *skypeURL = [NSURL URLWithString:[NSString stringWithFormat:@"skype://%@?call",    contactName]];
if ([[UIApplication sharedApplication] canOpenURL:skypeURL]) {
    [[UIApplication sharedApplication] openURL:skypeURL];
} else {
    // Display to the user how to install skype.
}

the same can happen for other programs which have a protocol definition that could be understood.

And just 4 the record, here's a list of know URL Schemes http://wiki.akosma.com/IPhone_URL_Schemes

Then, if you want your app to be URL-Scheme Compatible, you can have a good start by reading this: http://www.idev101.com/code/Objective-C/custom_url_schemes.html and this other post is really good and detailed.

How do you set your Cocoa application as the default web browser?

it explains how to make your app handle a custom URLScheme, which turns out to be your case.

hope it could be helpful.

k

for other case scenarios I got no idea if it is possible.

Community
  • 1
  • 1
holographix
  • 2,497
  • 2
  • 32
  • 46
  • How Can I make a program such that it would be invokable by external application using call like [[UIApplication sharedApplication] openURL:skypeURL]; as you wrote? – rakeshNS Feb 15 '12 at 12:23
  • I've just updated the response with a link that explains how to do that. ;-) – holographix Feb 15 '12 at 12:24
0

No, it's not possible to do that, unless the apps in question support URL Scheme, then you can launch it using URL.

X Slash
  • 4,133
  • 4
  • 27
  • 35
0

Not possible, because all iphone apps will run in a different individual process with their own runtime environment. There is only a limited IPC(Inter process communication) available, that too for system libs and resources.

Anil Kumar
  • 654
  • 1
  • 6
  • 18
0

No. There is no way to open an another app within app. However you can open an different app from your app vise versa by using

  1. URL Scheema

  2. Open_In functionality using CFBundleDocumentTypes and UIDocumentInteractionController.

iOSPawan
  • 2,884
  • 2
  • 25
  • 50