Wednesday, February 18, 2015

iOS - Google Chrome browser launch URLs


Looks like this is possible to display the App name as the navigational back button if we have Chrome browser installed in the device. 

Did a test in My TWC app by passing the url scheme like below 

    [[UIApplication sharedApplication]openURL:url2];


This opens up the google.com url in the chrome browser and shows the app name (passed in the x-source scheme parameter in the above scheme) in the browser. like in screenshot here. 


We can also utilise this feature in the following way

if(chromeInstalled) //using canOpenURL api. 
{
    [[UIApplication sharedApplication]openURL:url2];
}
else 
{
    NSURL *url2 = [NSURL URLWithString:@“http://www.google.com"];
    [[UIApplication sharedApplication]openURL:url2];

}

References
https://developer.chrome.com/multidevice/ios/links

No comments:

Post a Comment