0

Is there a way to open another app from my app? If my app has advertisement for another app, and that app is installed on device as well, is there a way to open that app from my app?

Thanks

update: looks like you need to know the scheme of the app, in order to launch it, but you cannot just lunch the app without any scheme and URL?

hzxu
  • 5,753
  • 11
  • 60
  • 95

4 Answers4

1

Yes, you have to use a concept known as URL schemes:

http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-working-with-url-schemes/

ColinE
  • 68,894
  • 15
  • 164
  • 232
1

Here is a nice tutorial on Using Custom URL Scheme in iOS

As in the tutorial, you should parse the URL parameters and store them to use in the app in this method:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
  // Do something with the url here
}

Here are a few examples …

myapp://

myapp://some/path/here

myapp://?foo=1&bar=2

myapp://some/path/here?foo=1&bar=2
Rajan Balana
  • 3,775
  • 25
  • 42
0

Yes , you can use URL scheme for open another app. see this reference.And here is the tutorial.

Dilip Manek
  • 9,095
  • 5
  • 44
  • 56
0

its just example to open to-do list in iPhone use following

Specify the app name and content you want to open, here "todolist://" is app name while remaining is content to open @"todolist://www.acme.com?Quarterly%20Report#200806231300"

NSURL *myURL = [NSURL URLWithString:@"todolist://www.acme.com?Quarterly%20Report#200806231300"];

[[UIApplication sharedApplication] openURL:myURL];

if you still dont find right, refer apple documentation section (Communicating with Other Apps) for it http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html

Dipen Panchasara
  • 13,480
  • 5
  • 47
  • 57