Denis Q.
Posts: 0
Joined: Mon Aug 05, 2013 10:04 am

open url in native browser android

Hi support,
I have an app that open my website when launched.

Now I would like open all external links with native browser in android devices.
In iphone/ipad i have solved by opening projcet in xcode and editing file MainViewController.m by adding following code:
(every image and every site without prefix http://www.icoinprice.com/app)

#pragma mark - UIWebViewDelegate

  • (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {

    // Open jpg files, OR External Links (not beginning with http://www.icoinprice.com/app) in Safari.app
    if (
    (navigationType == UIWebViewNavigationTypeLinkClicked) &&
    ([[[request URL] absoluteString] hasSuffix:@"jpg"]
    ||
    ![[[request URL] absoluteString] hasPrefix:@"http://www.icoinprice.com/app"])
    ) {

    Code: Select all

     [[UIApplication sharedApplication] openURL:request.URL]; 
     return NO; 

}

Code: Select all

 return YES; 

}

Could you help me to do the same thing with android devices ?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

open url in native browser android

Hi Denis,

Sorry for the delay. Please take a look at here:
http://stackoverflow.com/questions/15...

Return to “Issues”