plugin.adSense.*

类型
版本 2024.3703 版
关键字 AdSense、Google 广告、Google AdSense
平台 HTML5

概述

AdSense 插件允许您通过 Google AdSense 网络在 Web App 中展示横幅广告。AdSense 的其他广告格式目前处于封闭测试阶段,但会在未来的更新中加入。请注意,您可以在 adSense.init() 后使用 AdSense 自动广告,但此插件无法控制这些广告。

注册

您需要通过 AdSense 设置您的网站/应用程序。

语法

local adSense = require("plugin.adSense")

函数

adSense.init()

adSense.show()

adSense.hide()

adSense.height()

项目设置

要使用此插件,请在 build.settingsplugins 表中添加一个条目。添加之后,构建服务器将在构建阶段集成插件。

settings =
{
    plugins =
    {
        ["plugin.adSense"] =
        {
            publisherId = "com.solar2d"
        },
    },      
}

支持

* [Demo](https://github.com/solar2d/com.solar2d-plugin.adSense/tree/master/demo)
* [https://support.google.com/adsense/](https://support.google.com/adsense/)
* [Solar2D Forums](https://forums.solar2d.com/c/corona-marketplace/13)