2017-05-30 69 views
1

我在一些网站上看到过,显示的网页包含谷歌adsense在Android webview中违反了他们的政策。我可以在Chrome自定义标签中显示Google Adsense网页吗?

我想知道,我们是否可以在Chrome自定义选项卡中显示带有谷歌adsense的网页?

我有一个新闻网站和Android应用程序。我在应用中展示短消息,并在点击应用中的更多按钮时,会在浏览器中打开网页。我没有在webview中打开网页,因为我的网页包含谷歌广告。任何人都可以请建议,我是否可以使用Chrome自定义选项卡功能打开我的应用程序内的网页?请分享你的想法和经验。

回答

0

是的,你可以使用Chrome的自定义选项卡功能

使用下面这段代码:

dependencies {  
    compile 'com.android.support:customtabs:23.4.0' 
} 

打开Chrome自定义选项卡

Uri uri = Uri.parse("https://segunfamisa.com"); 

// create an intent builder 
CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder(); 

// Begin customizing 
// set toolbar colors 
intentBuilder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary)); 
intentBuilder.setSecondaryToolbarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark)); 

// set start and exit animations 
intentBuilder.setStartAnimations(this, R.anim.slide_in_right, R.anim.slide_out_left); 
intentBuilder.setExitAnimations(this, android.R.anim.slide_in_left, 
     android.R.anim.slide_out_right); 

// build custom tabs intent 
CustomTabsIntent customTabsIntent = intentBuilder.build(); 

// launch the url 
customTabsIntent.launchUrl(activity, uri); 
1

当你担心广告安置政策。

广告在软件应用

发布商不得通过软件应用程序搜索框发布谷歌广告或AdSense,包括但不限 到工具栏,浏览器扩展程序和桌面应用程序。 AdSense 代码可能只能在基于Web的页面和已批准的WebView 技术上实施。

Here是广告支持小组的回复,以便您关注。

如果是你,你自己选择在新标签中打开一个广告,当你点击它 自己(对别人的网站),那么这是一个观众的选择和 没有人能阻止你。

如果您的意思是您希望将自己的网站上的广告设置为在 新标签中打开,那么不可以,因为这会违反广告展示位置 政策。

希望现在很清楚。

相关问题