2

I'm trying to Launch an application within my App.
For example: If I press a Button in my testApp1, it should Open up testApp2.
Is there any Way to do this with the App Identifier??

I heard something about a undocumented method called launchApplicationWithIdentifier: suspend: but that doesn't work for me, or i'm using it wrong.
I tried this:
[UIApplication launchApplicationWithIdentifier:@"com.test.testApp2" suspend:NO]
But it didn't work.

foebe
  • 359
  • 7
  • 17

2 Answers2

2

Better use [[UIApplication sharedApplication] openUrl:]. You'll need set a custom URL scheme in your second app for that. Check this tutorial or simply do a search with "iphone custom URL schemes". There's a lot of good tutorials.

Youssef
  • 3,582
  • 1
  • 21
  • 28
  • 1
    I Alredy thought about that, but what should i do If I want to Launch an App which has no Custom URL scheme, for example a Alredy installed app?? – foebe Sep 10 '11 at 20:47
  • 1
    If it's an app that you didn't developed, you'll have to seek it's URL scheme, for example, to launch twitter, the URL would look like: twitter:// here's a list of [third-party schemes](http://wiki.akosma.com/IPhone_URL_Schemes#Third_Party_Applications) – Youssef Sep 10 '11 at 21:01
  • 1
    But still you can't Open every app you want, cause i don't think EVERY App has his own URL scheme. For example, what should i do If i want to Open the "iPod" app on my iPhone?? – foebe Sep 10 '11 at 21:07
  • That's the point, you can't launch every app on iOS. All you can do is check for each app if it can be opened using a URL scheme. – Youssef Sep 10 '11 at 21:39
  • So there's absolutly no Chance to Open a with it's Identifier?? Cause i searched Google and found sind posts in some Forums were People say you can Launch ANY App with it's Identifier by using `[UIApplication launchapplicationwithidentifier: suspend: ]` – foebe Sep 10 '11 at 21:44
  • I didn't find any DOCUMENTED way to do that, and checking UIApplication reference i can't find that method, maybe it's part of a iOS private API or a OS X method – Youssef Sep 10 '11 at 22:34
  • I don't know excatctly but i think it's a undocumented method. If it IS Part of iOS private API, is there any posibilty how to still use that method?? – foebe Sep 10 '11 at 23:17
0

I am not sure but i guess launchApplication is used for mac app thats why its showing warning. i will suggest you to create a custom URL and add it to plist file and then later you may launch your app using that url.

Praveen-K
  • 3,401
  • 1
  • 23
  • 31
  • Yeah, i can do that If the app that i want to Launch is One of my own, but what should i do If the app has no Custom URL scheme (a Alredy installed App.)?? – foebe Sep 10 '11 at 20:52