Reputation: 40496
I know it's possible to launch another app from within an app, using the openURL method. Also it is possible to check with canHandleURL if that app can open that URL.
But is there also a way to call an app and just let it do a calculation and then return the result?
Upvotes: 3
Views: 488
Reputation: 1282
Take a look here (example how to send a text to the called app)
in your case: let's say you have 2 apps (app1 and app2)
and 2 url schemes (protocolThatCallsApp1://
and protocolThatCallsApp2://
)
in your app1, you call app2 using protocolThatCallsApp2://
then in your app2 you make your calculations and call app1 using protocolThatCallsApp1://+yourCalculations
and you make the required parsing to get the result in your app1
Upvotes: 4
Reputation: 27506
The second app should use the same mechanism (openURL
) to call the first app.
The Facebook sdk uses this method to implement Single Sign-On:
If the app is running in a version of iOS that supports multitasking, and if the device has the Facebook app of version 3.2.3 or greater installed, the SDK attempts to open the authorization dialog within the Facebook app. After the user grants or declines the authorization, the Facebook app redirects back to the calling app, passing the authorization token, expiration, and any other parameters the Facebook OAuth server may return.
Upvotes: 2