0

Can we prevent application moving to foreground if other apps call openURL: with valid URL. I need only save data from URL; caller application should stay in foreground and receiver app should stay in background.

For example: first app calls to [[UIApplication sharedApplication] openURL:@"validURL://"] and second app handles that call in - (BOOL) application:(UIApplication *)app handleOpenURL:(NSURL *)url, process URL, but does not move to foreground

Ivan Lisovyi
  • 538
  • 5
  • 13

1 Answers1

0

No, but you might want to look at the x-callback-url movement to see if that might help. Basically, it doesn't prevent you from coming to the background, but it allows you to receive another URL which you can then use to bring the originating app back to the foreground.

gaige
  • 17,263
  • 6
  • 57
  • 68
  • Thanks for `x-callback-url`. I have alredy implement something similar in my app, receiver app returns control to caller app , but the main problem is still actual, i need to prevent caller from moving to foreground state – Ivan Lisovyi May 12 '13 at 12:18
  • 1
    Short of having an app running in the background and opening a local (not internet) TCP connection to it, there's really no way to communicated with an app without bringing it to the foreground, as the "No", from @phix23 and I both indicated. – gaige May 12 '13 at 13:56
  • @gaige, have you managed to open a TCP connection to an internal application, without internet, before? Can you share any link to your work, blog or tutorial? Thanks in advane – Ravindranath Akila Jul 22 '13 at 09:47
  • @RavindranathAkila I don't have any code I can share at this point, but the process is basically to create a listener using either CFPort (not TCP) or a socket and bind it locally and then connect to it with the foreground app. The remaining problem is finding a way to allow your app to remain running in the background. – gaige Jul 22 '13 at 10:25
  • @gaige Thanks! This very helpful. Yeah the background running is always a challenge. Need to figure that out. – Ravindranath Akila Aug 13 '13 at 09:18