Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 如何在flatterweb中插入Adsense显示广告_Flutter_Adsense_Flutter Web - Fatal编程技术网

Flutter 如何在flatterweb中插入Adsense显示广告

Flutter 如何在flatterweb中插入Adsense显示广告,flutter,adsense,flutter-web,Flutter,Adsense,Flutter Web,我创建了一个固定显示ad 320px*60px。我如何在我想要的地方插入Flatter web? 这是我从adsense获得的代码: <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- MyAd --> <ins class="adsbygoogle" style

我创建了一个固定显示ad 320px*60px。我如何在我想要的地方插入Flatter web? 这是我从adsense获得的代码:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MyAd -->
<ins class="adsbygoogle"
     style="display:inline-block;width:320px;height:60px"
     data-ad-client="xxxxxxxxx"
     data-ad-slot="xxxxxxxx"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

(adsbygoogle=window.adsbygoogle | |[]).push({});
或者,通过操纵flt玻璃面板,使Flitter不占据屏幕底部的60个像素,并在那里插入adsense广告,这是可能的吗


我正在寻找一种将adsense广告插入到内置于Flatter web的移动网站的方法

我能够将广告插入到Flatter web的listview中,如下所示: 创建了一个html文件adview.html

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:inline-block;width:320px;height:80px"
     data-ad-client="ca-pub-xxxxxx"
     data-ad-slot="xxxxxxx"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

然后,我们可以从函数adsenseAdsView()中添加小部件。我在ListView中添加了它。

有效吗?你在你的Adsense帐户中得到印象了吗?是的,我在Adsense中得到印象了。你的Flitter网站获得批准需要多长时间?你的网站已经有很多流量了吗?你是如何让你的申请获得批准的?我得到了一个“有价值的库存:没有内容”违规作为回应。我猜这些爬虫程序无法获取纯JS应用程序。
// ignore: avoid_web_libraries_in_flutter
import 'dart:html';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';

Widget adsenseAdsView() {
  // ignore: undefined_prefixed_name
  ui.platformViewRegistry.registerViewFactory(
      'adViewType',
      (int viewID) => IFrameElement()
        ..width = '320'
        ..height = '100'
        ..src = 'adview.html'
        ..style.border = 'none');

  return SizedBox(
    height: 100.0,
    width: 320.0,
    child: HtmlElementView(
      viewType: 'adViewType',
    ),
  );
}