{"_id":"59a51740192dba000fc9ca39","project":"574ff4bd3fa1870e00889ba6","version":{"_id":"574ff4bd3fa1870e00889ba9","project":"574ff4bd3fa1870e00889ba6","__v":26,"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","5b1a43bd678eab0003aa54a4","5b6d95e29d346300038baff3"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"category":{"_id":"57b722133d3e620e004ec74b","__v":0,"version":"574ff4bd3fa1870e00889ba9","project":"574ff4bd3fa1870e00889ba6","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-19T15:13:23.417Z","from_sync":false,"order":9,"slug":"ios-native-ads-mediation-layer","title":"iOS SDK"},"user":"5770fa1ce5a0000e0023c680","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-08-29T07:26:56.413Z","link_external":false,"link_url":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":14,"body":"PubNative Android Plugin for Corona supports 2 ad formats:\n\n  * **[Banners](http://developers.pubnative.net/v3.0/docs/android-plugin#corona-banner-plugin-integration)**\n  * **[Interstitials](http://developers.pubnative.net/v3.0/docs/android-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 Android 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\n## Permissions\n\nThe following permissions must be added to the manifest of the Android app that will contain the plugin:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"android.permission.INTERNET\\nandroid.permission.ACCESS_NETWORK_STATE\\nandroid.permission.ACCESS_COARSE_LOCATION (Optional)\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Corona Banner Plugin Integration\"\n}\n[/block]\n# Requirements\n\n  * Corona SDK project (You should already have a configured Corona project. You can find how to do this at https://docs.coronalabs.com/guide)\n  * Android Project **min API >= 15**\n  * An App Token provided in PubNative Dashboard\n  * A Placement Name configured in the PubNative Dashboard as **Small Layout**\n  * Permissions for Android project:\n  \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"android.permission.INTERNET\\nandroid.permission.ACCESS_NETWORK_STATE\\nandroid.permission.ACCESS_COARSE_LOCATION (Optional) \",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n# Installation\n\n# Download JAR file\nYou can download already prepared JAR file, which contain plugin classes inside, from https://github.com/pubnative/pubnative-corona-sdk/tree/master/banner/plugins/2017.3115/android\n\n# Clone Banner module from GitHub\nIf you don't want to use JAR files, we already have example of Corona Application at GitHub and you can simply use it for your app. For this clone project from https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/android and put it into your Corona Android app folder:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<YOUR_CORONA_APP_PROJECT>/android/\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**Note:** If you already have a fully functional Android app, better clone our app to separated folder and import banner module from it.\n\n# Add JAR to the Android project\nIf you are using JAR file, copy it file to `libs` folder inside of Corona android project:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<YOUR_CORONA_APP_PROJECT>/android/app/libs\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nand add the following line into your gradle build file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"compile fileTree(include: ['*.jar'], dir: 'libs')\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n# Include JAR dependencies\nAdd the Banner Plugin dependencies into your Corona Android gradle file: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"compile 'net.pubnative:player:2.0.1'\\ncompile 'com.google.code.gson:gson:2.8.1'\\ncompile 'net.pubnative:url_driller:1.3.4'\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n# Using\nNow you can include plugin into Lua by\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"local banner = require( \\\"plugin.pubnative.banner\\\" ) \",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\nThis will allow you use plugin inside of Lua code.\n\nPlugin has a three main methods:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"load(\\\"<APP_TOKEN>\\\", \\\"<PLACEMENT>\\\", listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\nLoad Banner data in background. **listener** this is a function which called from Banner when it's loaded.\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"show()\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nMethod show banner on the screen.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"hide() \",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nMethod hide banner from the screen.\n\nAnd has four helper methods (Should be called before show()):\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setBannerPositionTop()\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nMethod set position for the Banner to TOP. \n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setBannerPositionBottom()\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nMethod set position for the Banner to BOTTOM.\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setImpressionListener(listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**Optional.** If you wants to know when impression for banner will be detected, you can use this method. listener - function, which will be called from Banner Plugin\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setClickListener(listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**Optional.** If you wants to know when click for banner will be detected, you can use this method. listener - function, which will be called from Banner Plugin\n\n[block:api-header]\n{\n  \"title\": \"Corona Interstitial Plugin Integration\"\n}\n[/block]\n# Requirements\n\n  * Corona SDK project (You should already have a configured Corona project. You can find how to do this at https://docs.coronalabs.com/guide)\n  * Android Project **min API >= 15**\n  * An App Token provided in PubNative Dashboard\n  * A Placement Name configured in the PubNative Dashboard as **Large Layout**\n  * Permissions for Android project:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"android.permission.INTERNET\\nandroid.permission.ACCESS_NETWORK_STATE\\nandroid.permission.ACCESS_COARSE_LOCATION (Optional)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n#Installation\n\n#Download JAR file\n\nYou can download already prepared JAR file, which contain plugin classes inside, from https://github.com/pubnative/pubnative-corona-sdk/tree/master/interstitial/plugins/2017.3115/android\n\n#Clone Interstitial module from GitHub\n\nIf you don't want to use JAR files, we already have example of Corona Application at GitHub and you can simply use it for your app. For this clone project from https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/android and put it into your Corona Android app folder:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<YOUR_CORONA_APP_PROJECT>/android/\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**Note:** If you already have a fully functional Android app, better clone our app to separated folder and import interstitial module from it.\n\n# Add JAR to the Android project\nIf you are using JAR file, copy it file to `libs` folder inside of Corona android project:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<YOUR_CORONA_APP_PROJECT>/android/app/libs\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nand add the following line into your gradle build file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"compile fileTree(include: ['*.jar'], dir: 'libs') \",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n# Include JAR dependencies\nAdd the Interstitial Plugin dependencies into your Corona Android gradle file: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"compile 'net.pubnative:player:2.0.1'\\ncompile 'com.google.code.gson:gson:2.8.1'\\ncompile 'net.pubnative:url_driller:1.3.4'\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nThis is necessary or Plugin will not work.\n\n# Using\nNow you can include plugin into Lua by\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"local interstitial = require( \\\"plugin.pubnative.interstitial\\\" )\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nThis will allow you use plugin inside of Lua code.\n\nPlugin has a three main methods:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"load(\\\"<APP_TOKEN>\\\", \\\"<PLACEMENT>\\\", listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nLoad Banner data in background. listener this is a function which called from Banner when it's loaded.\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"show()\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nMethod show banner on the screen.\n\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"hide()\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nMethod hide banner from the screen. Normally, Interstitial will hide automatically after click on it.\n\nAnd has four helper methods (Should be called before show()):\n\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setShowListener(listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**Optional.** If you wants to know when interstitial shown, you can use this method. listener - function, which will be called from Interstitial Plugin\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setHideListener(listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**Optional.** If you wants to know when interstitial hidden, you can use this method. listener - function, which will be called from Interstitial Plugin\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setImpressionListener(listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**Optional.** If you wants to know when impression for banner will be detected, you can use this method. listener - function, which will be called from Interstitial Plugin\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setClickListener(listener)\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n\n\n**Optional.** If you wants to know when click for banner will be detected, you can use this method. listener - function, which will be called from Interstitial Plugin","excerpt":"","slug":"android-plugin","type":"basic","title":"Android Plugin"}
PubNative Android Plugin for Corona supports 2 ad formats: * **[Banners](http://developers.pubnative.net/v3.0/docs/android-plugin#corona-banner-plugin-integration)** * **[Interstitials](http://developers.pubnative.net/v3.0/docs/android-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 Android SDK * PubNative Corona Plugin * An **App Token** provided in PubNative Dashboard. * A **Placement Name** configured and obtained from the PubNative Dashboard ## Permissions The following permissions must be added to the manifest of the Android app that will contain the plugin: [block:code] { "codes": [ { "code": "android.permission.INTERNET\nandroid.permission.ACCESS_NETWORK_STATE\nandroid.permission.ACCESS_COARSE_LOCATION (Optional)", "language": "xml" } ] } [/block] [block:api-header] { "title": "Corona Banner Plugin Integration" } [/block] # Requirements * Corona SDK project (You should already have a configured Corona project. You can find how to do this at https://docs.coronalabs.com/guide) * Android Project **min API >= 15** * An App Token provided in PubNative Dashboard * A Placement Name configured in the PubNative Dashboard as **Small Layout** * Permissions for Android project: [block:code] { "codes": [ { "code": "android.permission.INTERNET\nandroid.permission.ACCESS_NETWORK_STATE\nandroid.permission.ACCESS_COARSE_LOCATION (Optional) ", "language": "java" } ] } [/block] # Installation # Download JAR file You can download already prepared JAR file, which contain plugin classes inside, from https://github.com/pubnative/pubnative-corona-sdk/tree/master/banner/plugins/2017.3115/android # Clone Banner module from GitHub If you don't want to use JAR files, we already have example of Corona Application at GitHub and you can simply use it for your app. For this clone project from https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/android and put it into your Corona Android app folder: [block:code] { "codes": [ { "code": "<YOUR_CORONA_APP_PROJECT>/android/", "language": "java" } ] } [/block] **Note:** If you already have a fully functional Android app, better clone our app to separated folder and import banner module from it. # Add JAR to the Android project If you are using JAR file, copy it file to `libs` folder inside of Corona android project: [block:code] { "codes": [ { "code": "<YOUR_CORONA_APP_PROJECT>/android/app/libs", "language": "java" } ] } [/block] and add the following line into your gradle build file: [block:code] { "codes": [ { "code": "compile fileTree(include: ['*.jar'], dir: 'libs')", "language": "java" } ] } [/block] # Include JAR dependencies Add the Banner Plugin dependencies into your Corona Android gradle file: [block:code] { "codes": [ { "code": "compile 'net.pubnative:player:2.0.1'\ncompile 'com.google.code.gson:gson:2.8.1'\ncompile 'net.pubnative:url_driller:1.3.4'", "language": "java" } ] } [/block] # Using Now you can include plugin into Lua by [block:code] { "codes": [ { "code": "local banner = require( \"plugin.pubnative.banner\" ) ", "language": "java" } ] } [/block] This will allow you use plugin inside of Lua code. Plugin has a three main methods: [block:code] { "codes": [ { "code": "load(\"<APP_TOKEN>\", \"<PLACEMENT>\", listener)", "language": "java" } ] } [/block] Load Banner data in background. **listener** this is a function which called from Banner when it's loaded. [block:code] { "codes": [ { "code": "show()", "language": "java" } ] } [/block] Method show banner on the screen. [block:code] { "codes": [ { "code": "hide() ", "language": "java" } ] } [/block] Method hide banner from the screen. And has four helper methods (Should be called before show()): [block:code] { "codes": [ { "code": "setBannerPositionTop()", "language": "java" } ] } [/block] Method set position for the Banner to TOP. [block:code] { "codes": [ { "code": "setBannerPositionBottom()", "language": "java" } ] } [/block] Method set position for the Banner to BOTTOM. [block:code] { "codes": [ { "code": "setImpressionListener(listener)", "language": "java" } ] } [/block] **Optional.** If you wants to know when impression for banner will be detected, you can use this method. listener - function, which will be called from Banner Plugin [block:code] { "codes": [ { "code": "setClickListener(listener)", "language": "java" } ] } [/block] **Optional.** If you wants to know when click for banner will be detected, you can use this method. listener - function, which will be called from Banner Plugin [block:api-header] { "title": "Corona Interstitial Plugin Integration" } [/block] # Requirements * Corona SDK project (You should already have a configured Corona project. You can find how to do this at https://docs.coronalabs.com/guide) * Android Project **min API >= 15** * An App Token provided in PubNative Dashboard * A Placement Name configured in the PubNative Dashboard as **Large Layout** * Permissions for Android project: [block:code] { "codes": [ { "code": "android.permission.INTERNET\nandroid.permission.ACCESS_NETWORK_STATE\nandroid.permission.ACCESS_COARSE_LOCATION (Optional)", "language": "java" } ] } [/block] #Installation #Download JAR file You can download already prepared JAR file, which contain plugin classes inside, from https://github.com/pubnative/pubnative-corona-sdk/tree/master/interstitial/plugins/2017.3115/android #Clone Interstitial module from GitHub If you don't want to use JAR files, we already have example of Corona Application at GitHub and you can simply use it for your app. For this clone project from https://github.com/pubnative/pubnative-corona-sdk/tree/master/demo/android and put it into your Corona Android app folder: [block:code] { "codes": [ { "code": "<YOUR_CORONA_APP_PROJECT>/android/", "language": "java" } ] } [/block] **Note:** If you already have a fully functional Android app, better clone our app to separated folder and import interstitial module from it. # Add JAR to the Android project If you are using JAR file, copy it file to `libs` folder inside of Corona android project: [block:code] { "codes": [ { "code": "<YOUR_CORONA_APP_PROJECT>/android/app/libs", "language": "java" } ] } [/block] and add the following line into your gradle build file: [block:code] { "codes": [ { "code": "compile fileTree(include: ['*.jar'], dir: 'libs') ", "language": "java" } ] } [/block] # Include JAR dependencies Add the Interstitial Plugin dependencies into your Corona Android gradle file: [block:code] { "codes": [ { "code": "compile 'net.pubnative:player:2.0.1'\ncompile 'com.google.code.gson:gson:2.8.1'\ncompile 'net.pubnative:url_driller:1.3.4'", "language": "java" } ] } [/block] This is necessary or Plugin will not work. # Using Now you can include plugin into Lua by [block:code] { "codes": [ { "code": "local interstitial = require( \"plugin.pubnative.interstitial\" )", "language": "java" } ] } [/block] This will allow you use plugin inside of Lua code. Plugin has a three main methods: [block:code] { "codes": [ { "code": "load(\"<APP_TOKEN>\", \"<PLACEMENT>\", listener)", "language": "java" } ] } [/block] Load Banner data in background. listener this is a function which called from Banner when it's loaded. [block:code] { "codes": [ { "code": "show()", "language": "java" } ] } [/block] Method show banner on the screen. [block:code] { "codes": [ { "code": "hide()", "language": "java" } ] } [/block] Method hide banner from the screen. Normally, Interstitial will hide automatically after click on it. And has four helper methods (Should be called before show()): [block:code] { "codes": [ { "code": "setShowListener(listener)", "language": "java" } ] } [/block] **Optional.** If you wants to know when interstitial shown, you can use this method. listener - function, which will be called from Interstitial Plugin [block:code] { "codes": [ { "code": "setHideListener(listener)", "language": "java" } ] } [/block] **Optional.** If you wants to know when interstitial hidden, you can use this method. listener - function, which will be called from Interstitial Plugin [block:code] { "codes": [ { "code": "setImpressionListener(listener)", "language": "java" } ] } [/block] **Optional.** If you wants to know when impression for banner will be detected, you can use this method. listener - function, which will be called from Interstitial Plugin [block:code] { "codes": [ { "code": "setClickListener(listener)", "language": "java" } ] } [/block] **Optional.** If you wants to know when click for banner will be detected, you can use this method. listener - function, which will be called from Interstitial Plugin