I want to open some of my external links with “chrome custom tab” and for this purpose I have installed a cordova plugin - “cordova-plugin-browser” (Github link - https://github.com/chemerisuk/cordova-plugin-browser)
So in my desired link, I am doing this - <a href="#" class="external" onclick="openLink($myurl)">View Details</a>
AND then in my app.js, I am doing this - //open in chrome custom tab function openLink(url){ var url = url; cordova.plugins.browser.open(url); }
Clicking the link does nothing. Actually I am unable to figure out how to use the plugin/or initiate the plugin when link is clicked.
Very less help is described in the plugin page. It says, to open a link in browser activity do - cordova.plugins.browser.open("https://google.com");
But “cordova-plugin-inappbrowser” is not a chrome custom tab, it 's like a custom made browser. I need to open external link only on chrome custom tab. Why? because those link (pages) have adsense-ad and as per adsense policy, adsense ad can be shown on pages if it is opened in chrome custom tabs. Opening in web-view or any custom browser inside the app is against the adsense policy.
I understand, but I need chrome custom tab. I have to follow Adsense program policies. It says-
AdSense for content (AFC) and Ad Exchange (AdX) display ads are not supported through all WebView technologies. App developers wishing to monetize by publishing AFC and AdX display ads through a WebView must use one of the following supported viewing frames:
Since I am not an expert, I am finding difficulties to understand the correct way (may be). I believe you can understand it and can suggest me what to write in my app.js