Launch iPhone Application with Identifier

2019-02-19 15:20发布

问题:

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.

回答1:

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.



回答2:

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.