{"_id":"59a3dc113026cb0019bf41d8","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-28T09:02:09.343Z","link_external":false,"link_url":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"Large Layout Ad is mediation of standard units that can be configured from the PubNative dashboard. Large Layout Ad view contains a predefined set of icon, banner, title, description, CTA and disclosure view. You can choose an ad type from PubNative dashboard like video only, banner only or description-banner-icon etc. You will get a fully created view in Large Layout that can be shown on screen using `show()` method. If you want to remove an ad from the screen or you're exiting the activity, you can use `hide()` method.\n[block:api-header]\n{\n  \"title\": \"Getting Started\"\n}\n[/block]\n* Before integrating Large Layout Ads in your app, you’ll need to go through the steps in our Getting started guide, create an account on PubNative and integrate the SDK into your project.\n* Add a Large Layout Ad unit to your app in the PubNative dashboard.\n* Make sure you have added the ad network SDKs you wish to use in your app.\n\nFor Large Layout Ads, first, you need to create a layout, then integrate lifecycle callbacks and load the ad. After these steps, you can start using it.\n[block:api-header]\n{\n  \"title\": \"Integration Steps\"\n}\n[/block]\n* [Create Large Layout](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#create-large-layout)\n* [Integrate Lifecycle Callbacks for Large Layout](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#integrate-lifecycle-callbacks-for-large-layout)\n* [Load Large Layout Ad](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#load-large-layout-ad)\n* [Use Large Layout Ad](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#use-large-layout-ad)\n[block:api-header]\n{\n  \"title\": \"Create Large Layout\"\n}\n[/block]\nYou can create predefined Large Layout Ad request using **PNLargeLayout**.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"let largeLayout = PNLargeLayout()\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PNLargeLayout *largeLayout = [[PNLargeLayout alloc] init];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Integrate Lifecycle Callbacks for Large Layout\"\n}\n[/block]\nYou can track the load process with callbacks using **PNLayoutLoadDelegate**.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"class YourClass: PNLayoutLoadDelegate \\n{\\n//...\\nfunc layoutDidFinishLoading(_ layout: PNLayout!)\\n{\\n    // Layout loaded\\n}\\n\\nfunc layout(_ layout: PNLayout!, didFailLoading error: Error!)\\n{\\n    // Layout load failed\\n}\\n//...\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \":::at:::interface YourClass () <PNLayoutLoadDelegate>\\n//...\\n- (void)layoutDidFinishLoading:(PNLayout *)layout\\n{\\n    // Layout loaded\\n}\\n\\n- (void)layout:(PNLayout *)layout didFailLoading:(NSError *)error\\n{\\n    // Layout load failed\\n}\\n//...\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nYou can track the tracking process, user interaction and ad behavior with callbacks using **PNLayoutTrackDelegate**. **_But you should set delegate only when Layout has been already loaded._**\nYou need to set the delegate as;\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"class YourClass: PNLayoutTrackDelegate \\n{\\n//...\\nlargeLayout.trackDelegate = self\\n//...\\nfunc layoutTrackClick(_ layout: PNLayout!) \\n{\\n    // Layout click tracked\\n}\\n    \\nfunc layoutTrackImpression(_ layout: PNLayout!) \\n{\\n    // Layout impression tracked\\n}\\n//...\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"@interface YourClass () <PNLayoutTrackDelegate>\\n//...\\nlargeLayout.trackDelegate = self;\\n//...\\n- (void)layoutTrackImpression:(PNLayout *)layout\\n{\\n    // Layout impression tracked\\n}\\n\\n- (void)layoutTrackClick:(PNLayout *)layout\\n{\\n    // Layout click tracked\\n}\\n//...\\n\",\n      \"language\": \"objectivec\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\nYou can track the view status with callbacks using **PNLayoutViewDelegate**. **_But you should set delegate only when Layout has been already loaded._**\nYou need to set the delegate as;\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"class YourClass: PNLayoutViewDelegate \\n{\\n//...\\nlargeLayout.viewDelegate = self\\n//...\\nfunc layoutDidShow(_ layout: PNLayout!) \\n{\\n    // Layout shown\\n}\\n    \\nfunc layoutDidHide(_ layout: PNLayout!)\\n{\\n    // Layout hidden\\n}\\n//...\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"@interface YourClass () <PNLayoutViewDelegate>\\n//...\\nlargeLayout.viewDelegate = self;\\n//...\\n- (void)layoutDidShow:(PNLayout *)layout\\n{\\n    // Layout shown\\n}\\n\\n- (void)layoutDidHide:(PNLayout *)layout\\n{\\n    // Layout hidden\\n}\\n//...\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Load Large Layout Ad\"\n}\n[/block]\nTo load Large Layout Ad;\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"largeLayout.load(withAppToken: \\\"<YOUR_APP_TOKEN>\\\", placement: \\\"<YOUR_PLACEMENT>\\\", delegate: self)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[largeLayout loadWithAppToken:@\\\"<YOUR_APP_TOKEN>\\\" placement:@\\\"<YOUR_PLACEMENT>\\\" delegate:self];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\nIn order to get callbacks from **PNLayout**, you should implement **PNLayoutLoadDelegate** for your class. Once an ad is loaded, you will get a fully created view in Large Layout that can be shown on screen using `show()` method. If you want to remove an ad from the screen, you can use `hide()` method.\n[block:api-header]\n{\n  \"title\": \"Use Large Layout Ad\"\n}\n[/block]\nOnce the load callback is invoked you can show the ad using the `show()` method or hide externally using `hide()`. Expect the user to close the ad by itself unless you have a specific need to hide it. If the ad is not ready any interaction with this method will do nothing.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Use this to show the fullscreen interstitial\\nlargeLayout.show()\\n// Use this to hide the fullscreen interstitial\\nlargeLayout.hide()\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Use this to show the fullscreen interstitial\\n[largeLayout show];\\n// Use this to hide the fullscreen interstitial\\n[largeLayout hide];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"large-ad-layouts-1","type":"basic","title":"Large Layout Ads"}
Large Layout Ad is mediation of standard units that can be configured from the PubNative dashboard. Large Layout Ad view contains a predefined set of icon, banner, title, description, CTA and disclosure view. You can choose an ad type from PubNative dashboard like video only, banner only or description-banner-icon etc. You will get a fully created view in Large Layout that can be shown on screen using `show()` method. If you want to remove an ad from the screen or you're exiting the activity, you can use `hide()` method. [block:api-header] { "title": "Getting Started" } [/block] * Before integrating Large Layout Ads in your app, you’ll need to go through the steps in our Getting started guide, create an account on PubNative and integrate the SDK into your project. * Add a Large Layout Ad unit to your app in the PubNative dashboard. * Make sure you have added the ad network SDKs you wish to use in your app. For Large Layout Ads, first, you need to create a layout, then integrate lifecycle callbacks and load the ad. After these steps, you can start using it. [block:api-header] { "title": "Integration Steps" } [/block] * [Create Large Layout](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#create-large-layout) * [Integrate Lifecycle Callbacks for Large Layout](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#integrate-lifecycle-callbacks-for-large-layout) * [Load Large Layout Ad](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#load-large-layout-ad) * [Use Large Layout Ad](http://developers.pubnative.net/v3.0/docs/large-ad-layouts-1#use-large-layout-ad) [block:api-header] { "title": "Create Large Layout" } [/block] You can create predefined Large Layout Ad request using **PNLargeLayout**. [block:code] { "codes": [ { "code": "let largeLayout = PNLargeLayout()", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "PNLargeLayout *largeLayout = [[PNLargeLayout alloc] init];", "language": "objectivec" } ] } [/block] [block:api-header] { "title": "Integrate Lifecycle Callbacks for Large Layout" } [/block] You can track the load process with callbacks using **PNLayoutLoadDelegate**. [block:code] { "codes": [ { "code": "class YourClass: PNLayoutLoadDelegate \n{\n//...\nfunc layoutDidFinishLoading(_ layout: PNLayout!)\n{\n // Layout loaded\n}\n\nfunc layout(_ layout: PNLayout!, didFailLoading error: Error!)\n{\n // Layout load failed\n}\n//...\n}", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "@interface YourClass () <PNLayoutLoadDelegate>\n//...\n- (void)layoutDidFinishLoading:(PNLayout *)layout\n{\n // Layout loaded\n}\n\n- (void)layout:(PNLayout *)layout didFailLoading:(NSError *)error\n{\n // Layout load failed\n}\n//...", "language": "objectivec" } ] } [/block] You can track the tracking process, user interaction and ad behavior with callbacks using **PNLayoutTrackDelegate**. **_But you should set delegate only when Layout has been already loaded._** You need to set the delegate as; [block:code] { "codes": [ { "code": "class YourClass: PNLayoutTrackDelegate \n{\n//...\nlargeLayout.trackDelegate = self\n//...\nfunc layoutTrackClick(_ layout: PNLayout!) \n{\n // Layout click tracked\n}\n \nfunc layoutTrackImpression(_ layout: PNLayout!) \n{\n // Layout impression tracked\n}\n//...\n}", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "@interface YourClass () <PNLayoutTrackDelegate>\n//...\nlargeLayout.trackDelegate = self;\n//...\n- (void)layoutTrackImpression:(PNLayout *)layout\n{\n // Layout impression tracked\n}\n\n- (void)layoutTrackClick:(PNLayout *)layout\n{\n // Layout click tracked\n}\n//...\n", "language": "objectivec", "name": null } ] } [/block] You can track the view status with callbacks using **PNLayoutViewDelegate**. **_But you should set delegate only when Layout has been already loaded._** You need to set the delegate as; [block:code] { "codes": [ { "code": "class YourClass: PNLayoutViewDelegate \n{\n//...\nlargeLayout.viewDelegate = self\n//...\nfunc layoutDidShow(_ layout: PNLayout!) \n{\n // Layout shown\n}\n \nfunc layoutDidHide(_ layout: PNLayout!)\n{\n // Layout hidden\n}\n//...\n}", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "@interface YourClass () <PNLayoutViewDelegate>\n//...\nlargeLayout.viewDelegate = self;\n//...\n- (void)layoutDidShow:(PNLayout *)layout\n{\n // Layout shown\n}\n\n- (void)layoutDidHide:(PNLayout *)layout\n{\n // Layout hidden\n}\n//...", "language": "objectivec" } ] } [/block] [block:api-header] { "title": "Load Large Layout Ad" } [/block] To load Large Layout Ad; [block:code] { "codes": [ { "code": "largeLayout.load(withAppToken: \"<YOUR_APP_TOKEN>\", placement: \"<YOUR_PLACEMENT>\", delegate: self)", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "[largeLayout loadWithAppToken:@\"<YOUR_APP_TOKEN>\" placement:@\"<YOUR_PLACEMENT>\" delegate:self];", "language": "objectivec" } ] } [/block] In order to get callbacks from **PNLayout**, you should implement **PNLayoutLoadDelegate** for your class. Once an ad is loaded, you will get a fully created view in Large Layout that can be shown on screen using `show()` method. If you want to remove an ad from the screen, you can use `hide()` method. [block:api-header] { "title": "Use Large Layout Ad" } [/block] Once the load callback is invoked you can show the ad using the `show()` method or hide externally using `hide()`. Expect the user to close the ad by itself unless you have a specific need to hide it. If the ad is not ready any interaction with this method will do nothing. [block:code] { "codes": [ { "code": "// Use this to show the fullscreen interstitial\nlargeLayout.show()\n// Use this to hide the fullscreen interstitial\nlargeLayout.hide()", "language": "swift" } ] } [/block] [block:code] { "codes": [ { "code": "// Use this to show the fullscreen interstitial\n[largeLayout show];\n// Use this to hide the fullscreen interstitial\n[largeLayout hide];", "language": "objectivec" } ] } [/block]