{"_id":"5a1fe8bf0588ac0028399ca4","project":"574ff4bd3fa1870e00889ba6","version":{"_id":"574ff4bd3fa1870e00889ba9","project":"574ff4bd3fa1870e00889ba6","__v":24,"createdAt":"2016-06-02T08:56:29.492Z","releaseDate":"2016-06-02T08:56:29.492Z","categories":["574ff4bd3fa1870e00889baa","577278ecdceb570e003a9001","577279865617b117009e643f","577279985617b117009e6440","577279bc8c48e00e00503504","5774fe18605b770e0037be8a","577ce3ad87acf617003c4187","577f8476a77c700e006a6c52","57b486ae0d2b640e00e9d3f5","57b722133d3e620e004ec74b","57bd95f00fe3a00e003e2cc5","57c8349359cd4b0e00b888ef","57c8349b5754fa1700b12242","57cedb0bad483e0e00890239","57cedbe807d7ea0e00e438cc","57d82967156ef72b007ffcd8","58ee353ad1ee2f0f0034a13d","596623221738df00298622a5","59a51730192dba000fc9ca38","59a8129f1e7b26000fa0fb1a","5a0322bf044b6f001c236e36","5a79897c5b6e430030746df6","5a79898c2b2d5f0012cbab63","5ab3b5e3d2d1e2006252a8f2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"category":{"_id":"59a51730192dba000fc9ca38","project":"574ff4bd3fa1870e00889ba6","version":"574ff4bd3fa1870e00889ba9","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-08-29T07:26:40.465Z","from_sync":false,"order":11,"slug":"corona-sdk","title":"Corona SDK"},"user":"5770fa1ce5a0000e0023c680","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-11-30T11:17:19.507Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"PubNative iOS Plugin for Corona supports 2 ad formats:\n\n  * **[Banners](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-banner-plugin-integration)**\n  * **[Interstitials](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-interstitial-plugin-integration)**\n\nPlease follow this integration guide to configure PubNative ads.\n[block:api-header]\n{\n  \"title\": \"Requirements\"\n}\n[/block]\n* Corona SDK project. - _You should have already configured a Corona project. You can find how to do this at [here](https://docs.coronalabs.com/guide)_\n* PubNative iOS SDK\n* PubNative Corona Plugin\n* An **App Token** provided in PubNative Dashboard.\n* A **Placement Name** configured and obtained from the PubNative Dashboard\n[block:api-header]\n{\n  \"title\": \"Install PubNative iOS SDK\"\n}\n[/block]\n[Download](https://github.com/pubnative/pubnative-ios-sdk/releases) and install the PubNative iOS SDK as described in [here](http://developers.pubnative.net/docs/for-developers-1#install-pubnative-sdk).\n\n**Important Note:** PubNative iOS SDK supports iOS 8.0 and up. Full-featured SDK supports iOS 9.0 and up.\n[block:api-header]\n{\n  \"title\": \"Corona Native Plugin Integration\"\n}\n[/block]\nLet's continue with the integration of Corona Native Plugin. You can integrate this plugin into 2 ad formats:\n\n  * **[Banners](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-banner-plugin-integration)**\n  * **[Interstitials](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-interstitial-plugin-integration)**\n[block:api-header]\n{\n  \"title\": \"Corona Banner Plugin Integration\"\n}\n[/block]\nWe already have an example of Corona Demo Application at GitHub and you can simply use it for your app. For that, clone [this project](https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/ios) and put it into your Corona iOS app folder:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<YOUR_CORONA_APP_PROJECT>/ios/\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIf 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.)_**\n\n# Usage\n\nNow you can include plugin into Lua by\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"local banner = require(\\\"plugin.pubnative.banner\\\") \",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nThis will allow you use plugin inside of Lua code.\n\n### Main Methods\n\nThe Corona iOS Plugin Banner has **3 main methods**:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"1. load(\\\"<APP_TOKEN>\\\", \\\"<PLACEMENT>\\\", listener)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nMethod for loading the Banner data in the background. **`listener`** is a function which called from Banner when it's loaded.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"2. show(bannerPosition)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nMethod for showing the Banner on the screen. **`bannerPosition`** is the desired position for the banner (Top or Bottom).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"3. hide() \",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nMethod for hiding the Banner from the screen.\n\n\n### Helper Methods\n\nThe Corona iOS Plugin Banner has **2 helper methods**, which should be called before `show(bannerPosition)`. Both of these methods are optional:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"1. setImpressionListener(listener)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nIf 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.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"2. setClickListener(listener)\\n\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nIf 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.\n[block:api-header]\n{\n  \"title\": \"Corona Interstitial Plugin Integration\"\n}\n[/block]\nWe already have an example of Corona Application at GitHub and you can simply use it for your app. For that, clone [this project](https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/ios) and put it into your Corona iOS app folder:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<YOUR_CORONA_APP_PROJECT>/ios/\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIf 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.)_**\n\n# Usage\n\nNow you can include plugin into Lua by\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"local interstitial = require(\\\"plugin.pubnative.interstitial\\\")\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nThis will allow you use plugin inside of Lua code.\n\n### Main Methods\n\nThe Corona iOS Plugin Interstitial has **3 main methods**:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"1. load(\\\"<APP_TOKEN>\\\", \\\"<PLACEMENT>\\\", listener)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nMethod for loading the Interstitial data in the background. **`listener`** is a function which called from Interstitial when it's loaded.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"2. show()\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nMethod for showing the Interstitial on the screen. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"3. hide()\\n\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nMethod for hiding the Interstitial from the screen. Normally, Interstitial will hide automatically after click on it.\n\n### Helper Methods\n\nThe Corona iOS Plugin Banner has **4 helper methods**, which should be called before `show()`. All of these methods are optional:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"1. setShowListener(listener)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nIf 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.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"2. setHideListener(listener)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nIf you want to know when the Interstitial hidden, you can use this method. **`listener`** is a function, which will be called from Interstitial Plugin.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setImpressionListener(listener)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nIf 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.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setClickListener(listener)\",\n      \"language\": \"lua\"\n    }\n  ]\n}\n[/block]\nIf 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.","excerpt":"","slug":"ios-plugin","type":"basic","title":"iOS Plugin"}
PubNative iOS Plugin for Corona supports 2 ad formats: * **[Banners](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-banner-plugin-integration)** * **[Interstitials](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-interstitial-plugin-integration)** Please follow this integration guide to configure PubNative ads. [block:api-header] { "title": "Requirements" } [/block] * Corona SDK project. - _You should have already configured a Corona project. You can find how to do this at [here](https://docs.coronalabs.com/guide)_ * PubNative iOS SDK * PubNative Corona Plugin * An **App Token** provided in PubNative Dashboard. * A **Placement Name** configured and obtained from the PubNative Dashboard [block:api-header] { "title": "Install PubNative iOS SDK" } [/block] [Download](https://github.com/pubnative/pubnative-ios-sdk/releases) and install the PubNative iOS SDK as described in [here](http://developers.pubnative.net/docs/for-developers-1#install-pubnative-sdk). **Important Note:** PubNative iOS SDK supports iOS 8.0 and up. Full-featured SDK supports iOS 9.0 and up. [block:api-header] { "title": "Corona Native Plugin Integration" } [/block] Let's continue with the integration of Corona Native Plugin. You can integrate this plugin into 2 ad formats: * **[Banners](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-banner-plugin-integration)** * **[Interstitials](http://developers.pubnative.net/v3.0/docs/ios-plugin#corona-interstitial-plugin-integration)** [block:api-header] { "title": "Corona Banner Plugin Integration" } [/block] 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](https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/ios) and put it into your Corona iOS app folder: [block:code] { "codes": [ { "code": "<YOUR_CORONA_APP_PROJECT>/ios/", "language": "shell" } ] } [/block] 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 [block:code] { "codes": [ { "code": "local banner = require(\"plugin.pubnative.banner\") ", "language": "lua" } ] } [/block] This will allow you use plugin inside of Lua code. ### Main Methods The Corona iOS Plugin Banner has **3 main methods**: [block:code] { "codes": [ { "code": "1. load(\"<APP_TOKEN>\", \"<PLACEMENT>\", listener)", "language": "lua" } ] } [/block] Method for loading the Banner data in the background. **`listener`** is a function which called from Banner when it's loaded. [block:code] { "codes": [ { "code": "2. show(bannerPosition)", "language": "lua" } ] } [/block] Method for showing the Banner on the screen. **`bannerPosition`** is the desired position for the banner (Top or Bottom). [block:code] { "codes": [ { "code": "3. hide() ", "language": "lua" } ] } [/block] 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: [block:code] { "codes": [ { "code": "1. setImpressionListener(listener)", "language": "lua" } ] } [/block] 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. [block:code] { "codes": [ { "code": "2. setClickListener(listener)\n", "language": "lua" } ] } [/block] 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. [block:api-header] { "title": "Corona Interstitial Plugin Integration" } [/block] We already have an example of Corona Application at GitHub and you can simply use it for your app. For that, clone [this project](https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/ios) and put it into your Corona iOS app folder: [block:code] { "codes": [ { "code": "<YOUR_CORONA_APP_PROJECT>/ios/", "language": "shell" } ] } [/block] 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 [block:code] { "codes": [ { "code": "local interstitial = require(\"plugin.pubnative.interstitial\")", "language": "lua" } ] } [/block] This will allow you use plugin inside of Lua code. ### Main Methods The Corona iOS Plugin Interstitial has **3 main methods**: [block:code] { "codes": [ { "code": "1. load(\"<APP_TOKEN>\", \"<PLACEMENT>\", listener)", "language": "lua" } ] } [/block] Method for loading the Interstitial data in the background. **`listener`** is a function which called from Interstitial when it's loaded. [block:code] { "codes": [ { "code": "2. show()", "language": "lua" } ] } [/block] Method for showing the Interstitial on the screen. [block:code] { "codes": [ { "code": "3. hide()\n", "language": "lua" } ] } [/block] 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: [block:code] { "codes": [ { "code": "1. setShowListener(listener)", "language": "lua" } ] } [/block] 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. [block:code] { "codes": [ { "code": "2. setHideListener(listener)", "language": "lua" } ] } [/block] 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. [block:code] { "codes": [ { "code": "setImpressionListener(listener)", "language": "lua" } ] } [/block] 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. [block:code] { "codes": [ { "code": "setClickListener(listener)", "language": "lua" } ] } [/block] 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.