unityads.*

Type Library
Revision Current Public Release (2018.3326)
Keywords ads, advertising, Unity Ads
Platforms Android, iOS

Overview

The Unity Ads plugin allows developers to monetize users through Unity Ads video interstitial and rewarded video ads.

The Unity Ads plugin is only available to users who have purchased the Corona Professional Bundle or the Unity Ads plugin. This plugin lets you keep 100% of your ad revenue and allows you to manage your account/settings with Unity Ads directly.

Important

On a per-app basis, the first time a Unity ad appears, the user will see a banner with the option to opt-out of behaviorally targeted advertising. Thereafter, the user can click an information button to receive the opt-out again.

Although UnityAds will automatically present users with an opportunity to opt-out of targeted advertising, with no implementation needed from the publisher, check out new setHasUserConsent method to enable manual GDPR data collection restrictions.

See more at Unity Ads GDPR Compliance doc page

Registration

Before you can use this plugin, you must register with Unity Ads.

Syntax

local unityads = require( "plugin.unityads" )

Functions

Events

Project Settings

To use this plugin, add an entry into the plugins table of build.settings. When added, the build server will integrate the plugin during the build phase. 

settings =
{
    plugins =
    {
        ["plugin.unityads"] =
        {
            publisherId = "com.coronalabs"
        },
    },
}
Important

If you are building for Android, you should remove any legacy inclusion of the ["plugin.google.play.services"] plugin from your build.settings.

Note

For Android, the following permissions/features are automatically added when using this plugin:

  • "android.permission.INTERNET"
  • "android.permission.ACCESS_NETWORK_STATE"

Support