2

Objective : A button in iOS native app when clicked opens a url (webpage) in native browser (safari or other, not UiWebView as it no longer supports html file control api) then, using javascript in the opened webpage, close that browser window so revealing the app again.

Opening the URL from the native app is not an issue: How to launch safari and open URL from iOS app?

Closing that resultant browser window is an issue, is there a way to accomplish this?


Community
  • 1
  • 1
Ultradiv
  • 179
  • 2
  • 11

1 Answers1

0

Launching Your Own Application via a Custom URL Scheme and Pass Parameters.

Here is a nice tutorial on Using Custom URL Scheme in iOS

As in the tutorial, you should parse the URL parameters and store them to use in the app in this method:

    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
      sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
    {
        NSLog(@"Calling Application Bundle ID: %@", sourceApplication);
        NSLog(@"URL scheme:%@", [url scheme]);
        NSLog(@"URL query: %@", [url query]);

        return YES;
    }
Vignesh Kumar
  • 598
  • 4
  • 11