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 
NSURL *url2 = [NSURL URLWithString:@"googlechrome-x-callback://x-callback-url/open/?x-source=MyApp&x-success=myapp%3A%2F%2F&url=http%3A%2F%2Fwww.google.com"];
    [[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. 
{
 NSURL *url2 = [NSURL URLWithString:@"googlechrome-x-callback://x-callback-url/open/?x-source=MyApp&x-success=myapp%3A%2F%2F&url=http%3A%2F%2Fwww.google.com"];
    [[UIApplication sharedApplication]openURL:url2];
}
else 
{
    [[UIApplication sharedApplication]openURL:url2];
}
References
https://developer.chrome.com/multidevice/ios/links
 
No comments:
Post a Comment