{"_id":"5a1fe8bf0588ac0028399ca4","project":"574ff4bd3fa1870e00889ba6","version":{"_id":"574ff4bd3fa1870e00889ba9","project":"574ff4bd3fa1870e00889ba6","__v":21,"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"],"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/docs/ios-plugin#corona-banner-plugin-integration)**\n  * **[Interstitials](http://developers.pubnative.net/docs/ios-plugin#corona-interstitial-plugin-integration)**\n\nPlease follow this integration guide to configure PubNative ads.\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  * PubNative SDK\n  * An **App Token** provided in PubNative Dashboard.\n  * A **Placement Name** configured in the PubNative Dashboard.\n[block:api-header]\n{\n  \"title\": \"PubNative SDK Installation\"\n}\n[/block]\nThere are 2 ways to integrate our iOS SDK:\n  * Drag and Drop **Pubnative.framework**\n  * Drag and Drop **sdk/sdk** folder \n\n# Drag and Drop **Pubnative.framework**\n  * Download **Pubnative.framework** file and add it into your app. For this, simply drag and drop framework file to Embedded Binaries on project configuration page.\n  * Select your target and navigate to the **“Build Phases”**. Then, add a **Run Script** step to your build steps.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/fe44677-Screen_Shot_2017-11-30_at_12.19.10.png\",\n        \"Screen Shot 2017-11-30 at 12.19.10.png\",\n        604,\n        177,\n        \"#ebebeb\"\n      ]\n    }\n  ]\n}\n[/block]\n* Put it after your step to embed frameworks, set it to use /bin/sh and enter the following script:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"APP_PATH=\\\"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\\\"\\n\\nfind \\\"$APP_PATH\\\" -name 'Pubnative.framework' -type d | while read -r FRAMEWORK\\ndo\\n    FRAMEWORK_EXECUTABLE_NAME=$(defaults read \\\"$FRAMEWORK/Info.plist\\\" CFBundleExecutable)\\n    FRAMEWORK_EXECUTABLE_PATH=\\\"$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME\\\"\\n    echo \\\"Executable is $FRAMEWORK_EXECUTABLE_PATH\\\"\\n\\n    EXTRACTED_ARCHS=()\\n\\n    for ARCH in $ARCHS\\n    do\\n        echo \\\"Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME\\\"\\n        lipo -extract \\\"$ARCH\\\" \\\"$FRAMEWORK_EXECUTABLE_PATH\\\" -o \\\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\\\"\\n        EXTRACTED_ARCHS+=(\\\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\\\")\\n    done\\n\\n    echo \\\"Merging extracted architectures: ${ARCHS}\\\"\\n    lipo -o \\\"$FRAMEWORK_EXECUTABLE_PATH-merged\\\" -create \\\"${EXTRACTED_ARCHS[:::at:::]}\\\"\\n    rm \\\"${EXTRACTED_ARCHS[@]}\\\"\\n\\n    echo \\\"Replacing original executable with thinned version\\\"\\n    rm \\\"$FRAMEWORK_EXECUTABLE_PATH\\\"\\n    mv \\\"$FRAMEWORK_EXECUTABLE_PATH-merged\\\" \\\"$FRAMEWORK_EXECUTABLE_PATH\\\"\\n\\ndone\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n* Do not forget to check your project’s *“Frameworks Search Paths”* in your Build Settings. Make sure that the path for **Pubnative.framework** is provided correctly.\n\n# Drag and Drop **sdk/sdk** folder\n\nIf you are below iOS 8, you can manually clone the repository and drag and drop **sdk/sdk** folder into your Xcode application group. (Be sure to check the “Copy items into destination group’s folder” option.)\n[block:api-header]\n{\n  \"title\": \"Corona Native Plugin Installation\"\n}\n[/block]\n#Getting the necessary files\n\nWe 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/ios and put it into your Corona iOS app folder:\n\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# Using\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\": \"shell\"\n    }\n  ]\n}\n[/block]\nThis will allow you use plugin inside of Lua code.\n\nPlugin has a three main methods:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"1. load(\\\"<APP_TOKEN>\\\", \\\"<PLACEMENT>\\\", listener)\",\n      \"language\": \"shell\"\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\": \"2. show(bannerPosition)\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nMethod show banner on the screen. **bannerPosition** is the desired position for the banner (top or bottom).\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"3. hide() \",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nMethod hide banner from the screen.\n\n\nAnd has two helper methods (Should be called before show(**bannerPosition**)):\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"1. setImpressionListener(listener)\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n**Optional**. If you want to know when impression for banner will be detected, you can use this method. **listener** - function, which will be called from Banner Plugin.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"2. setClickListener(listener)\\n\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n**Optional**. If you want 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  * PubNative SDK\n  * An **App Token** provided in PubNative Dashboard.\n  * A **Placement Name** configured in the PubNative Dashboard.\n[block:api-header]\n{\n  \"title\": \"PubNative SDK Installation\"\n}\n[/block]\nThere are 2 ways to integrate our iOS SDK:\n  * Drag and Drop **Pubnative.framework**\n  * Drag and Drop **sdk/sdk** folder \n\n# Drag and Drop **Pubnative.framework**\n  * Download **Pubnative.framework** file and add it into your app. For this, simply drag and drop framework file to Embedded Binaries on project configuration page.\n  * Select your target and navigate to the **“Build Phases”**. Then, add a **Run Script** step to your build steps.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ede7f84-Screen_Shot_2017-11-30_at_12.19.10.png\",\n        \"Screen Shot 2017-11-30 at 12.19.10.png\",\n        604,\n        177,\n        \"#ebebeb\"\n      ]\n    }\n  ]\n}\n[/block]\nPut it after your step to embed frameworks, set it to use /bin/sh and enter the following script:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"APP_PATH=\\\"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\\\"\\n\\nfind \\\"$APP_PATH\\\" -name 'Pubnative.framework' -type d | while read -r FRAMEWORK\\ndo\\n    FRAMEWORK_EXECUTABLE_NAME=$(defaults read \\\"$FRAMEWORK/Info.plist\\\" CFBundleExecutable)\\n    FRAMEWORK_EXECUTABLE_PATH=\\\"$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME\\\"\\n    echo \\\"Executable is $FRAMEWORK_EXECUTABLE_PATH\\\"\\n\\n    EXTRACTED_ARCHS=()\\n\\n    for ARCH in $ARCHS\\n    do\\n        echo \\\"Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME\\\"\\n        lipo -extract \\\"$ARCH\\\" \\\"$FRAMEWORK_EXECUTABLE_PATH\\\" -o \\\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\\\"\\n        EXTRACTED_ARCHS+=(\\\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\\\")\\n    done\\n\\n    echo \\\"Merging extracted architectures: ${ARCHS}\\\"\\n    lipo -o \\\"$FRAMEWORK_EXECUTABLE_PATH-merged\\\" -create \\\"${EXTRACTED_ARCHS[@]}\\\"\\n    rm \\\"${EXTRACTED_ARCHS[@]}\\\"\\n\\n    echo \\\"Replacing original executable with thinned version\\\"\\n    rm \\\"$FRAMEWORK_EXECUTABLE_PATH\\\"\\n    mv \\\"$FRAMEWORK_EXECUTABLE_PATH-merged\\\" \\\"$FRAMEWORK_EXECUTABLE_PATH\\\"\\n\\ndone\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n* Do not forget to check your project’s *“Frameworks Search Paths”* in your Build Settings. Make sure that the path for **Pubnative.framework** is provided correctly.\n\n# Drag and Drop **sdk/sdk** folder\n\nIf you are below iOS 8, you can manually clone the repository and drag and drop **sdk/sdk** folder into your Xcode application group. (Be sure to check the “Copy items into destination group’s folder” option.)\n[block:api-header]\n{\n  \"title\": \"Corona Native Plugin Installation\"\n}\n[/block]\n# Getting the necessary files\nWe 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/ios and put it into your Corona iOS app folder:\n\n\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# Using\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\": \"shell\"\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\": \"1. load(\\\"<APP_TOKEN>\\\", \\\"<PLACEMENT>\\\", listener)\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nLoad Banner data in background. **listener** this is a function which called from Banner when it's loaded.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"2. show()\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nMethod show banner on the screen.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"3. hide()\\n\",\n      \"language\": \"shell\"\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[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"1. setShowListener(listener)\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n**Optional**. If you want to know when interstitial shown, you can use this method. **listener** - function, which will be called from Interstitial Plugin.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"2. setHideListener(listener)\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n**Optional**. If you want to know when interstitial hidden, you can use this method. **listener** - function, which will be called from Interstitial Plugin.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"setImpressionListener(listener)\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n**Optional**. If you want to know when impression for interstitial 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\": \"shell\"\n    }\n  ]\n}\n[/block]\n**Optional**. If you want to know when click for interstitial will be detected, you can use this method. **listener** - 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/docs/ios-plugin#corona-banner-plugin-integration)** * **[Interstitials](http://developers.pubnative.net/docs/ios-plugin#corona-interstitial-plugin-integration)** Please follow this integration guide to configure PubNative ads. [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) * PubNative SDK * An **App Token** provided in PubNative Dashboard. * A **Placement Name** configured in the PubNative Dashboard. [block:api-header] { "title": "PubNative SDK Installation" } [/block] There are 2 ways to integrate our iOS SDK: * Drag and Drop **Pubnative.framework** * Drag and Drop **sdk/sdk** folder # Drag and Drop **Pubnative.framework** * Download **Pubnative.framework** file and add it into your app. For this, simply drag and drop framework file to Embedded Binaries on project configuration page. * Select your target and navigate to the **“Build Phases”**. Then, add a **Run Script** step to your build steps. [block:image] { "images": [ { "image": [ "https://files.readme.io/fe44677-Screen_Shot_2017-11-30_at_12.19.10.png", "Screen Shot 2017-11-30 at 12.19.10.png", 604, 177, "#ebebeb" ] } ] } [/block] * Put it after your step to embed frameworks, set it to use /bin/sh and enter the following script: [block:code] { "codes": [ { "code": "APP_PATH=\"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\"\n\nfind \"$APP_PATH\" -name 'Pubnative.framework' -type d | while read -r FRAMEWORK\ndo\n FRAMEWORK_EXECUTABLE_NAME=$(defaults read \"$FRAMEWORK/Info.plist\" CFBundleExecutable)\n FRAMEWORK_EXECUTABLE_PATH=\"$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME\"\n echo \"Executable is $FRAMEWORK_EXECUTABLE_PATH\"\n\n EXTRACTED_ARCHS=()\n\n for ARCH in $ARCHS\n do\n echo \"Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME\"\n lipo -extract \"$ARCH\" \"$FRAMEWORK_EXECUTABLE_PATH\" -o \"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\"\n EXTRACTED_ARCHS+=(\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\")\n done\n\n echo \"Merging extracted architectures: ${ARCHS}\"\n lipo -o \"$FRAMEWORK_EXECUTABLE_PATH-merged\" -create \"${EXTRACTED_ARCHS[@]}\"\n rm \"${EXTRACTED_ARCHS[@]}\"\n\n echo \"Replacing original executable with thinned version\"\n rm \"$FRAMEWORK_EXECUTABLE_PATH\"\n mv \"$FRAMEWORK_EXECUTABLE_PATH-merged\" \"$FRAMEWORK_EXECUTABLE_PATH\"\n\ndone", "language": "shell" } ] } [/block] * Do not forget to check your project’s *“Frameworks Search Paths”* in your Build Settings. Make sure that the path for **Pubnative.framework** is provided correctly. # Drag and Drop **sdk/sdk** folder If you are below iOS 8, you can manually clone the repository and drag and drop **sdk/sdk** folder into your Xcode application group. (Be sure to check the “Copy items into destination group’s folder” option.) [block:api-header] { "title": "Corona Native Plugin Installation" } [/block] #Getting the necessary 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/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.) # Using Now you can include plugin into Lua by [block:code] { "codes": [ { "code": "local banner = require( \"plugin.pubnative.banner\" ) ", "language": "shell" } ] } [/block] This will allow you use plugin inside of Lua code. Plugin has a three main methods: [block:code] { "codes": [ { "code": "1. load(\"<APP_TOKEN>\", \"<PLACEMENT>\", listener)", "language": "shell" } ] } [/block] Load Banner data in background. **listener** this is a function which called from Banner when it's loaded. [block:code] { "codes": [ { "code": "2. show(bannerPosition)", "language": "shell" } ] } [/block] Method show banner on the screen. **bannerPosition** is the desired position for the banner (top or bottom). [block:code] { "codes": [ { "code": "3. hide() ", "language": "shell" } ] } [/block] Method hide banner from the screen. And has two helper methods (Should be called before show(**bannerPosition**)): [block:code] { "codes": [ { "code": "1. setImpressionListener(listener)", "language": "shell" } ] } [/block] **Optional**. If you want 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": "2. setClickListener(listener)\n", "language": "shell" } ] } [/block] **Optional**. If you want 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) * PubNative SDK * An **App Token** provided in PubNative Dashboard. * A **Placement Name** configured in the PubNative Dashboard. [block:api-header] { "title": "PubNative SDK Installation" } [/block] There are 2 ways to integrate our iOS SDK: * Drag and Drop **Pubnative.framework** * Drag and Drop **sdk/sdk** folder # Drag and Drop **Pubnative.framework** * Download **Pubnative.framework** file and add it into your app. For this, simply drag and drop framework file to Embedded Binaries on project configuration page. * Select your target and navigate to the **“Build Phases”**. Then, add a **Run Script** step to your build steps. [block:image] { "images": [ { "image": [ "https://files.readme.io/ede7f84-Screen_Shot_2017-11-30_at_12.19.10.png", "Screen Shot 2017-11-30 at 12.19.10.png", 604, 177, "#ebebeb" ] } ] } [/block] Put it after your step to embed frameworks, set it to use /bin/sh and enter the following script: [block:code] { "codes": [ { "code": "APP_PATH=\"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\"\n\nfind \"$APP_PATH\" -name 'Pubnative.framework' -type d | while read -r FRAMEWORK\ndo\n FRAMEWORK_EXECUTABLE_NAME=$(defaults read \"$FRAMEWORK/Info.plist\" CFBundleExecutable)\n FRAMEWORK_EXECUTABLE_PATH=\"$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME\"\n echo \"Executable is $FRAMEWORK_EXECUTABLE_PATH\"\n\n EXTRACTED_ARCHS=()\n\n for ARCH in $ARCHS\n do\n echo \"Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME\"\n lipo -extract \"$ARCH\" \"$FRAMEWORK_EXECUTABLE_PATH\" -o \"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\"\n EXTRACTED_ARCHS+=(\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\")\n done\n\n echo \"Merging extracted architectures: ${ARCHS}\"\n lipo -o \"$FRAMEWORK_EXECUTABLE_PATH-merged\" -create \"${EXTRACTED_ARCHS[@]}\"\n rm \"${EXTRACTED_ARCHS[@]}\"\n\n echo \"Replacing original executable with thinned version\"\n rm \"$FRAMEWORK_EXECUTABLE_PATH\"\n mv \"$FRAMEWORK_EXECUTABLE_PATH-merged\" \"$FRAMEWORK_EXECUTABLE_PATH\"\n\ndone", "language": "shell" } ] } [/block] * Do not forget to check your project’s *“Frameworks Search Paths”* in your Build Settings. Make sure that the path for **Pubnative.framework** is provided correctly. # Drag and Drop **sdk/sdk** folder If you are below iOS 8, you can manually clone the repository and drag and drop **sdk/sdk** folder into your Xcode application group. (Be sure to check the “Copy items into destination group’s folder” option.) [block:api-header] { "title": "Corona Native Plugin Installation" } [/block] # Getting the necessary 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/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.). # Using Now you can include plugin into Lua by [block:code] { "codes": [ { "code": "local interstitial = require( \"plugin.pubnative.interstitial\" )", "language": "shell" } ] } [/block] This will allow you use plugin inside of Lua code. Plugin has a three main methods: [block:code] { "codes": [ { "code": "1. load(\"<APP_TOKEN>\", \"<PLACEMENT>\", listener)", "language": "shell" } ] } [/block] Load Banner data in background. **listener** this is a function which called from Banner when it's loaded. [block:code] { "codes": [ { "code": "2. show()", "language": "shell" } ] } [/block] Method show banner on the screen. [block:code] { "codes": [ { "code": "3. hide()\n", "language": "shell" } ] } [/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": "1. setShowListener(listener)", "language": "shell" } ] } [/block] **Optional**. If you want to know when interstitial shown, you can use this method. **listener** - function, which will be called from Interstitial Plugin. [block:code] { "codes": [ { "code": "2. setHideListener(listener)", "language": "shell" } ] } [/block] **Optional**. If you want 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": "shell" } ] } [/block] **Optional**. If you want to know when impression for interstitial will be detected, you can use this method. **listener** - function, which will be called from Interstitial Plugin. [block:code] { "codes": [ { "code": "setClickListener(listener)", "language": "shell" } ] } [/block] **Optional**. If you want to know when click for interstitial will be detected, you can use this method. **listener** - function, which will be called from Interstitial Plugin.