appodeal.*

Type Library
Revision 2018.3301
Keywords ads, advertising, Appodeal
Platforms Android, iOS
Sample https://github.com/coronalabs/plugins-sample-appodeal

Overview

The Appodeal plugin allows developers to monetize their mobile app with Appodeal banner, static interstitial, video interstitial, and rewarded video ads.

Important

Appodeal contains various SDKs for the ad providers it mediates. This means that you can not use Appodeal in conjunction with AdColony, AppLovin, AdMob, Chartboost, Facebook Audience Network, Flurry Analytics, InMobi, Unity Ads, or Vungle.

Important

Beta version of Corona Appodeal plugin is now available! Check latest note in Project Settings section to learn more.

Important

Check out new hasUserConsent init parameter to enable GDPR data collection restrictions.

Registration

Before you can use this plugin, you must register with Appodeal.

Syntax

local appodeal = require( "plugin.appodeal" )

Functions

Events

Project Settings

To use this plugin in legacy mode, 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.appodeal"] =
        {
            publisherId = "com.coronalabs"
        },
    },
}

To use this plugin in modular mode, your plugins table of build.settings should look like this:

settings =
{
plugins =
{
-- Base
['plugin.appodeal.base'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.AmazonAds'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.GoogleAdMob'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.TwitterMoPub'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' },

-- Banner
['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Yandex'] = { publisherId = 'com.coronalabs' },

-- Interstitial
['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Ogury'] = { publisherId = 'com.coronalabs' },

-- Rewarded Video
['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Unity'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Vungle'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Tapjoy'] = { publisherId = 'com.coronalabs' },
},
}

Make sure to include Base block for a plugin to work correctly. Then you can just comment out unnecessary ad types blocks, so that unneded adapters are not downloaded and linked to your project.

Note

Disabling specific ad types and ad providers at this level with the help of new modular structure can greatly reduce the final build size.

For example, if you don't use Interstitials or Rewarded Video ad types in your app, you can comment blocks:

-- Interstitial
--['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Ogury'] = { publisherId = 'com.coronalabs' },

-- Rewarded Video
--['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Unity'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Vungle'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Tapjoy'] = { publisherId = 'com.coronalabs' },

If for some reason you don't want to show ads from specific ad provider (for the sake of example, let it be Flurry), you can comment out it too, like this:

-- Banner
['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' },
--['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Yandex'] = { publisherId = 'com.coronalabs' },

If you are sure of your choice and want to keep your build settings nice and clean, you can remove commented ad types or/and adapters. Then for this particular example your build.settings file should look like this:

settings =
{
plugins =
{
-- Base
['plugin.appodeal.base'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.AmazonAds'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.GoogleAdMob'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.TwitterMoPub'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' },

-- Banner
['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.Yandex'] = { publisherId = 'com.coronalabs' },
},
}
Note

From now on, you can use a beta version of modular plugin system. It includes the latest Appodeal SDK Beta, some new features and improvements. To use it, you should add a beta tag to module declaration like this, for example:

['plugin.appodeal.beta.base'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.AdColony'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.AmazonAds'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.AppLovin'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Appnext'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Chartboost'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.FacebookAudience'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Flurry'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.GoogleAdMob'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.InMobi'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.IronSource'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Mobvista'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.MyTarget'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Ogury'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.StartApp'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Tapjoy'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.TwitterMoPub'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Unity'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Vungle'] = { publisherId = 'com.coronalabs' },
['plugin.appodeal.beta.Yandex'] = { publisherId = 'com.coronalabs' },

Please keep in mind, that using beta versions of both Appodeal SDK and Corona Appodeal plugin may cause unexpected issues. We've made a profound tests of a new system, but you should use it at your own risk.

Important

If building for iOS, you must bypass App Transport Security (ATS) by adding the following to the plist table of build.settings. While Corona Labs does not blindly encourage this approach for all developers and projects, bypassing ATS is required in certain cases. For more information on ATS, please see the Managing App Transport Security guide.

settings =
{
    iphone =
    {
        plist =
        {
            NSAppTransportSecurity = { NSAllowsArbitraryLoads=true },
        },
    },
}
Note

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

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

In addition, if you wish to receive targeted ads in your app and increase your chances for higher revenue, you can include any or all of the following permissions:

  • "android.permission.GET_ACCOUNTS"
  • "android.permission.ACCESS_COARSE_LOCATION"
  • "android.permission.ACCESS_FINE_LOCATION"