PubNative iOS Plugin for Corona supports 2 ad formats:

Please follow this integration guide to configure PubNative ads.

Requirements

  • Corona SDK project. - You should have already configured a Corona project. You can find how to do this at here
  • PubNative iOS SDK
  • PubNative Corona Plugin
  • An App Token provided in PubNative Dashboard.
  • A Placement Name configured and obtained from the PubNative Dashboard

Install PubNative iOS SDK

Download and install the PubNative iOS SDK as described in here.

Important Note: PubNative iOS SDK supports iOS 8.0 and up. Full-featured SDK supports iOS 9.0 and up.

Corona Native Plugin Integration

Let's continue with the integration of Corona Native Plugin. You can integrate this plugin into 2 ad formats:

Corona Banner Plugin Integration

We already have an example of Corona Demo Application at GitHub and you can simply use it for your app. For that, clone this project and put it into your Corona iOS app folder:

<YOUR_CORONA_APP_PROJECT>/ios/

If you do not want to get the whole example application, you can simply get the contents of the PluginBanner folder and add it to your Plugin Project. (Be sure to check the “Copy items into destination group’s folder” option.)

Usage

Now you can include plugin into Lua by

local banner = require("plugin.pubnative.banner")

This will allow you use plugin inside of Lua code.

Main Methods

The Corona iOS Plugin Banner has 3 main methods:

1. load("<APP_TOKEN>", "<PLACEMENT>", listener)

Method for loading the Banner data in the background. listener is a function which called from Banner when it's loaded.

2. show(bannerPosition)

Method for showing the Banner on the screen. bannerPosition is the desired position for the banner (Top or Bottom).

3. hide()

Method for hiding the Banner from the screen.

Helper Methods

The Corona iOS Plugin Banner has 2 helper methods, which should be called before show(bannerPosition). Both of these methods are optional:

1. setImpressionListener(listener)

If you want to know when impression for the Banner will be detected, you can use this method. listener is a function, which will be called from Banner Plugin.

2. setClickListener(listener)

If you want to know when click for the Banner will be detected, you can use this method. listener is a function, which will be called from Banner Plugin.

Corona Interstitial Plugin Integration

We already have an example of Corona Application at GitHub and you can simply use it for your app. For that, clone this project and put it into your Corona iOS app folder:

<YOUR_CORONA_APP_PROJECT>/ios/

If you do not want to get the whole example application, you can simply get the contents of the PluginInterstitial folder and add it to your Plugin Project. (Be sure to check the “Copy items into destination group’s folder” option.)

Usage

Now you can include plugin into Lua by

local interstitial = require("plugin.pubnative.interstitial")

This will allow you use plugin inside of Lua code.

Main Methods

The Corona iOS Plugin Interstitial has 3 main methods:

1. load("<APP_TOKEN>", "<PLACEMENT>", listener)

Method for loading the Interstitial data in the background. listener is a function which called from Interstitial when it's loaded.

2. show()

Method for showing the Interstitial on the screen.

3. hide()

Method for hiding the Interstitial from the screen. Normally, Interstitial will hide automatically after click on it.

Helper Methods

The Corona iOS Plugin Banner has 4 helper methods, which should be called before show(). All of these methods are optional:

1. setShowListener(listener)

If you want to know when the Interstitial has shown, you can use this method. listener is a function, which will be called from Interstitial Plugin.

2. setHideListener(listener)

If you want to know when the Interstitial hidden, you can use this method. listener is a function, which will be called from Interstitial Plugin.

setImpressionListener(listener)

If you want to know when impression for the Interstitial will be detected, you can use this method. listener is a function, which will be called from Interstitial Plugin.

setClickListener(listener)

If you want to know when click for the Interstitial will be detected, you can use this method. listener is a function, which will be called from Interstitial Plugin.