0

It is now a common practice to show a band at the top of the application to allow users to switch back to the application which launched the current foreground app. We can see the bar in Facebook Messenger when launched from main Facebook app, in Maps app when launched from Safari etc. (See image below: "Touch to return to Facebook")

I understand that it will be possible to show the band simply by taking the name of the application from sourceApplication

-(BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

and then show the band as a view at the top of the application. Handle user tap on the band (which will be a UIView) and then invoke the scheme of the launcher app which we will already know.

enter image description here

But my question is -- Is there any API available which lets you do this? This is because the just pushing the Application down may mess with the existing UI and everything.

Anindya Sengupta
  • 2,539
  • 2
  • 21
  • 27

1 Answers1

0

It's an informal protocol involving the x-source and x-success parameters passed into the openURL of the google maps app URL scheme. It's all part of the x-callback-url protocol for exchanging data in this manner.

Anya Shenanigans
  • 91,618
  • 3
  • 107
  • 122
  • Thanks a lot for your answer. I am actually interested in how to show the band at the top of the screen (by pushing the launched app down) which says "Back to app|. User taps on it and the source app is launched back. I checked out the link you have given, it does not implement such feature. – Anindya Sengupta Sep 09 '14 at 13:29
  • Oops, you were looking for an implementation of a small banner at the top of your application rather than how it works. – Anya Shenanigans Sep 09 '14 at 13:47
  • Petesh, Problem is we can just show a UIView at the top, but it will obscure the nav bar. I would rather like an implementation where, we can make it look as if the status bar has extended. Again, this can be done the hard way by using custom nav bars and all, but I wanted to know if there is any existing API which allows to implement "Touch to return to App" functionality out of the box. – Anindya Sengupta Sep 09 '14 at 13:53
  • Because the entire thing is 'ad-hoc' there's no available API for doing this out of the box. – Anya Shenanigans Sep 09 '14 at 13:54
  • Thanks for the answer Petesh. You seem to be right. I have to do it myself. :) – Anindya Sengupta Sep 10 '14 at 09:54