Reputation: 800
I have 2 iPhone apps installed in the same device, app A and app B. app A doesn't have any remote server connectivity. app A has to invoke app B for the remote server communication. app B will make the server call & will return the response to app A. I want to use 'Apple URL Schemes' for this Inter App communication. The issue is that when app A invoke app B, app A will go to background and app B will come foreground. But I want this communication to happen without user notice. Always app A should be in the foreground for the user.
So the solution can be like this. app A invokes app b for the server call. app A will enter background mode and app B will come foreground. The method in the app A will detect the background mode & will bring it back to foreground. Similarly, method in app B will detect the foreground mode & will bring it back to background in some fraction of seconds. So the user will see only some flashing of screens when the apps switch. app B will execute the task in background & will return the result to app A.
I want to know whether this can be handled in iOS? Any suggestions are greatly appreciated.
Upvotes: 3
Views: 3971
Reputation: 371
If one fix the scope in the question (like URL Scheme), you are limited by the scope. But if one free oneself, one may ask or keep on asking such as - is the App extension later help this question.
Upvotes: 0
Reputation: 17860
You can try something like that. I'm theorizing here, not sure if step #5-6 will actually work, but I think it worth trying
openUrl: @"appB://startsomething"
openUrl: @"appA://resume
openUrl: @"appA://data=GOT_DATA"
Upvotes: 6
Reputation: 50089
it can be handled PARTLY.
a can use b for the server call
but b has to stay in foreground to invoke the url back to a
Upvotes: 1