Sonal Maheshwari
Sonal Maheshwari

Reputation: 217

Communicating between ios apps

I hav got two ios apps..app1 and app2. Now what i want is to start app2 from app1. this can be done using openUrl method and url schemes. But i want to launch app2 only when app1 goes to background/is suspended.

I am able to launch app2 from AppDelegate's applicationWillEnterForeground...but same code is not working in AppDelegate's applicationDidEnterbackground method or applicationWillResignActive.

Can anyone tell me how to launch app2 from app1 when user leaves app1.

On checking the logs, it shows following:

: Entitlement com.apple.springboard.openurlinbackground required to use BOOL _verifyURLEntitlement(mach_port_t, NSURL , SBSApplicationLaunchFromURLFlags, SBApplication *) from background app : LaunchServices: application launch failed - received error code 1

Upvotes: 1

Views: 773

Answers (1)

Victor Ronin
Victor Ronin

Reputation: 23268

First of all, Iron Man gave a good link, which is applicable only for jailbroken devices.

Secondly, there is no legal and documented way to do this. Apple mantra is that users decides what should a device do. In this case, a user pressed Home button, so it shouldn't randomly go to some other app.

Potentially you can find some private API which will allow you to do something like that. However, it won't be accepted in app store.

Upvotes: 1

Related Questions