{"id":10018,"date":"2024-06-30T11:42:19","date_gmt":"2024-06-30T09:42:19","guid":{"rendered":"https:\/\/refinery89.com\/docs\/monetize-app-sdk-documentation\/use-manual\/ad-formats\/interstitial\/"},"modified":"2024-07-02T11:43:41","modified_gmt":"2024-07-02T09:43:41","slug":"interstitial","status":"publish","type":"docs","link":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/ad-formats\/interstitial\/","title":{"rendered":"Interstitial"},"content":{"rendered":"<h1 id=\"Prerequisites\" data-renderer-start-pos=\"1\">Prerequisites<\/h1>\n<ul class=\"ak-ul\" data-indent-level=\"1\">\n<li>\n<p data-renderer-start-pos=\"18\"><a class=\"cc-1rn59kg\" title=\"#\" href=\"https:\/\/refinery89.com\/docs\/monetize-app-sdk-documentation\/use-manual\/get-started\/\" target=\"_blank\" rel=\"noopener\" data-testid=\"link-with-safety\" data-renderer-mark=\"true\">Get Started<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h1 id=\"Load-&amp;-Show-the-Ad\" data-renderer-start-pos=\"34\">Load &amp; Show the Ad<\/h1>\n<p data-renderer-start-pos=\"54\">Consider a scenario where a button click triggers an Interstitial and, subsequently, the <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">NewActivity<\/code> is launched from <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">MainActivity.<\/code><\/p>\n<h2 id=\"Load\" data-renderer-start-pos=\"187\">Load<\/h2>\n<div class=\"code-block\">\n<pre>              # MainActivity.kt -&gt; onCreate()\r\n              val interstitialConfigId = ConfigBuilder.INTERSTITIAL_TEST_R89_CONFIG_ID\r\n              val activityToShowOver = this\r\n              var interstitialId = RefineryAdFactory.createInterstitial(\r\n                  interstitialConfigId,\r\n                  activityToShowOver,\r\n                  afterInterstitial = {\r\n                      \/\/ Here you could load the next activity or fragment. Basically recover app flow\r\n                      Log.d(\"Interstitial\", \"After Interstitial\")\r\n                      \/\/ Example\r\n                      val newActivityIntent = Intent(activityToShowOver, NewActivity::class.java)\r\n                      activityToShowOver.startActivity(newActivityIntent)\r\n                  }\r\n              )\r\n<\/pre>\n<\/div>\n<h2 id=\"Show-On-Button-Press\" data-renderer-start-pos=\"705\">Show On Button Press<\/h2>\n<p data-renderer-start-pos=\"727\">Some events take place in you app, such as a button press, tab change or opening a link.<\/p>\n<div class=\"ak-editor-panel cc-tqp4ke sdk-warning\" data-panel-type=\"warning\">\n<div class=\"ak-editor-panel__content\">\n<p data-renderer-start-pos=\"818\">If the Interstitial hasn\u2019t Loaded yet or failed to load when you call <code class=\"code cc-1o5d2cw\" data-renderer-mark=\"true\">show<\/code>, the flow will continue normally<\/p>\n<\/div>\n<\/div>\n<p><\/br><\/p>\n<div class=\"code-block\">\n<pre>      # MainActivity.kt -&gt; onCreate()\r\n      \/\/ Example of a button press\r\n      findViewById&lt;Button&gt;(&lt;YOUR_BUTTON_ID&gt;).setOnClickListener {\r\n          RefineryAdFactory.show(interstitialId)\r\n      }\r\n<\/pre>\n<\/div>\n<h1 id=\"Show-on-Creation-of-the-Interstitial\" data-renderer-start-pos=\"1091\">Show on Creation of the Interstitial<\/h1>\n<div class=\"ak-editor-panel cc-tqp4ke sdk-error\" data-panel-type=\"error\">\n<div class=\"ak-editor-panel__content\">\n<p data-renderer-start-pos=\"1130\"><strong data-renderer-mark=\"true\">This will increase the time it takes to perform the user action. <\/strong><\/p>\n<p>Because its making the Ad Request when the user takes the action. <strong data-renderer-mark=\"true\">You should use the previous approach<\/strong> where we make the request and store the ad ID for instant showing it when the user performs the actions.<\/p>\n<p>This is how we use Interstitial we use in Demos.<\/p>\n<\/div>\n<\/div>\n<p><\/br><\/p>\n<div class=\"code-block\">\n<pre>      # MainActivity.kt -&gt; onCreate()\r\n      findViewById&lt;Button&gt;(&lt;YOUR_BUTTON_ID&gt;).setOnClickListener {\r\n          createInterstitial()\r\n      }\r\n<\/pre>\n<\/div>\n<div class=\"code-block\">\n<pre>        # MainActivity.kt\r\n        private fun createInterstitial() {\r\n            val interstitialAdId = ConfigBuilder.INTERSTITIAL_TEST_R89_CONFIG_ID\r\n            val lifecycleEvents = object : InterstitialEventListener {\r\n                \/*\r\n                 * We need to call show on the onLoaded event and on the OnFailedToLoad event,\r\n                 * this is to show the ad in both cases so the afterInterstitial event is called\r\n                 *\/\r\n                override fun onLoaded() {\r\n                    RefineryAdFactory.show(interstitialId)\r\n                }\r\n        \r\n                override fun onFailedToLoad(error: R89LoadError) {\r\n                    RefineryAdFactory.show(interstitialId)\r\n                }\r\n        \r\n                \/\/ Implement other lifecycle event callbacks as needed\r\n                override fun onOpened() {\r\n                    \/\/ Handle ad opened event\r\n                }\r\n        \r\n                override fun onClosed() {\r\n                    \/\/ Handle ad closed event\r\n                }\r\n        \r\n                override fun onClicked() {\r\n                    \/\/ Handle ad clicked event\r\n                }\r\n        \r\n                override fun onImpression() {\r\n                    \/\/ Handle ad impression event\r\n                }\r\n            }\r\n        \r\n            interstitialId = RefineryAdFactory.createInterstitial(\r\n                interstitialAdId, this,\r\n                afterInterstitial = {\r\n                    Log.d(\"Interstitial\", \"After Interstitial\")\r\n                },\r\n                lifecycleCallbacks = lifecycleEvents\r\n            )\r\n        }\r\n<\/pre>\n<\/div>\n<h1 id=\"Lifecycle-Events\" data-renderer-start-pos=\"2327\">Lifecycle Events<\/h1>\n<p data-renderer-start-pos=\"2345\">You can subscribe to these events with the same method but passing a new object as a parameter. Details about this object can be found in the <a class=\"cc-1rn59kg\" title=\"https:\/\/refinery89.atlassian.net\/wiki\/spaces\/R8P\/pages\/528842754\" href=\"https:\/\/sdk-reference.refinery89.com\/\" data-testid=\"link-with-safety\" data-renderer-mark=\"true\">Reference<\/a>.<\/p>\n<p data-renderer-start-pos=\"2499\">OnClose is not present because we have an <a class=\"cc-1rn59kg\" title=\"#afterInterstitial\" href=\"#After-Interstitial\" data-testid=\"link-with-safety\" data-renderer-mark=\"true\">after interstitial<\/a> event that is mandatory to pass as a parameter and holds the same functionality that OnClose with special cases.<\/p>\n<div class=\"inline-extension-renderer cc-yqgtfn\"><span class=\"_1e0c1o8l _4t3i1x4e _1bsbidpf\"><a name=\"afterInterstitial\" data-group=\"deeplink\"><\/a><a name=\"Interstitial-afterInterstitial\" data-group=\"deeplink\"><\/a><\/span><\/div>\n<h2 id=\"[inlineExtension]After-Interstitial\" data-renderer-start-pos=\"2674\">After Interstitial<\/h2>\n<p data-renderer-start-pos=\"2695\">This is not passed as a separated object like the other Events because is mandatory to handle what happens after an Interstitial is closed. This is invoked in the SDK when:<\/p>\n<ul class=\"ak-ul\" data-indent-level=\"1\">\n<li>\n<p data-renderer-start-pos=\"2871\">Everything went right and the user just closed the full screen ad.<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"2941\">The ad hasn&#8217;t loaded yet and you tried to show it.<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"2995\">The ad has been Invalidated and you tried to show it. Gets invalidated when:<\/p>\n<ul class=\"ak-ul\" data-indent-level=\"2\">\n<li>\n<p data-renderer-start-pos=\"3075\">Fails to load.<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"3093\">Already shown.<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"3111\">Too Long without showing it.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"3145\">The ad failed to show.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"featured_media":0,"parent":10015,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-10018","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Interstitial | Refinery89<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/formati-pubblicitari\/interstitial\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Interstitial | Refinery89\" \/>\n<meta property=\"og:description\" content=\"Prerequisites Get Started. Load &amp; Show the Ad Consider a scenario where a button click triggers an Interstitial and, subsequently, the NewActivity is launched from MainActivity. Load # MainActivity.kt -&gt; onCreate() val interstitialConfigId = ConfigBuilder.INTERSTITIAL_TEST_R89_CONFIG_ID val activityToShowOver = this var interstitialId = RefineryAdFactory.createInterstitial( interstitialConfigId, activityToShowOver, afterInterstitial = { \/\/ Here you could load the next [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/formati-pubblicitari\/interstitial\/\" \/>\n<meta property=\"og:site_name\" content=\"Refinery89\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Refinery89\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-02T09:43:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@refinery89\" \/>\n<meta name=\"twitter:label1\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/\",\"url\":\"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/\",\"name\":\"Interstitial | Refinery89\",\"isPartOf\":{\"@id\":\"https:\/\/refinery89.com\/#website\"},\"datePublished\":\"2024-06-30T09:42:19+00:00\",\"dateModified\":\"2024-07-02T09:43:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/refinery89.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android &#8211; Monetize App SDK Documentation\",\"item\":\"https:\/\/refinery89.com\/docs\/monetize-app-sdk-documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Private: Use Manual\",\"item\":\"https:\/\/refinery89.com\/?post_type=docs&p=10006\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Ad Formats\",\"item\":\"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/formati-pubblicitari\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Interstitial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/refinery89.com\/#website\",\"url\":\"https:\/\/refinery89.com\/\",\"name\":\"Refinery89\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/refinery89.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/refinery89.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/refinery89.com\/#organization\",\"name\":\"Refinery89\",\"alternateName\":\"R89\",\"url\":\"https:\/\/refinery89.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/refinery89.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\",\"contentUrl\":\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\",\"width\":200,\"height\":200,\"caption\":\"Refinery89\"},\"image\":{\"@id\":\"https:\/\/refinery89.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Refinery89\/\",\"https:\/\/x.com\/refinery89\",\"https:\/\/www.linkedin.com\/company\/refinery89\/\",\"https:\/\/www.youtube.com\/@refinery89\",\"https:\/\/www.instagram.com\/refinery_89\/\",\"https:\/\/www.reddit.com\/user\/Refinery89\/\",\"https:\/\/share.google\/K8hFf3ktmUrTi1XCa\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Interstitial | Refinery89","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/formati-pubblicitari\/interstitial\/","og_locale":"it_IT","og_type":"article","og_title":"Interstitial | Refinery89","og_description":"Prerequisites Get Started. Load &amp; Show the Ad Consider a scenario where a button click triggers an Interstitial and, subsequently, the NewActivity is launched from MainActivity. Load # MainActivity.kt -&gt; onCreate() val interstitialConfigId = ConfigBuilder.INTERSTITIAL_TEST_R89_CONFIG_ID val activityToShowOver = this var interstitialId = RefineryAdFactory.createInterstitial( interstitialConfigId, activityToShowOver, afterInterstitial = { \/\/ Here you could load the next [&hellip;]","og_url":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/formati-pubblicitari\/interstitial\/","og_site_name":"Refinery89","article_publisher":"https:\/\/www.facebook.com\/Refinery89\/","article_modified_time":"2024-07-02T09:43:41+00:00","og_image":[{"width":200,"height":200,"url":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@refinery89","twitter_misc":{"Tempo di lettura stimato":"2 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/","url":"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/","name":"Interstitial | Refinery89","isPartOf":{"@id":"https:\/\/refinery89.com\/#website"},"datePublished":"2024-06-30T09:42:19+00:00","dateModified":"2024-07-02T09:43:41+00:00","breadcrumb":{"@id":"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/refinery89.com\/fr\/docs\/monetize-app-sdk-documentation\/use-manual\/formats-publicitaires\/interstitial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/refinery89.com\/"},{"@type":"ListItem","position":2,"name":"Android &#8211; Monetize App SDK Documentation","item":"https:\/\/refinery89.com\/docs\/monetize-app-sdk-documentation\/"},{"@type":"ListItem","position":3,"name":"Private: Use Manual","item":"https:\/\/refinery89.com\/?post_type=docs&p=10006"},{"@type":"ListItem","position":4,"name":"Ad Formats","item":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/formati-pubblicitari\/"},{"@type":"ListItem","position":5,"name":"Interstitial"}]},{"@type":"WebSite","@id":"https:\/\/refinery89.com\/#website","url":"https:\/\/refinery89.com\/","name":"Refinery89","description":"","publisher":{"@id":"https:\/\/refinery89.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/refinery89.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/refinery89.com\/#organization","name":"Refinery89","alternateName":"R89","url":"https:\/\/refinery89.com\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/","url":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","contentUrl":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","width":200,"height":200,"caption":"Refinery89"},"image":{"@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Refinery89\/","https:\/\/x.com\/refinery89","https:\/\/www.linkedin.com\/company\/refinery89\/","https:\/\/www.youtube.com\/@refinery89","https:\/\/www.instagram.com\/refinery_89\/","https:\/\/www.reddit.com\/user\/Refinery89\/","https:\/\/share.google\/K8hFf3ktmUrTi1XCa"]}]}},"comment_count":0,"_links":{"self":[{"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/docs\/10018","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/comments?post=10018"}],"version-history":[{"count":0,"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/docs\/10018\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/docs\/10015"}],"next":[{"title":"Infinite Scroll","link":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/ad-formats\/infinite-scroll\/","href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/docs\/10019"}],"prev":[{"title":"Outstream","link":"https:\/\/refinery89.com\/it\/docs\/monetize-app-sdk-documentation\/use-manual\/ad-formats\/outstream\/","href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/docs\/10017"}],"wp:attachment":[{"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/media?parent=10018"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/refinery89.com\/it\/wp-json\/wp\/v2\/doc_tag?post=10018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}