{"id":768,"date":"2017-01-09T14:34:55","date_gmt":"2017-01-09T05:34:55","guid":{"rendered":"http:\/\/blue-bear.jp\/kb\/?p=768"},"modified":"2017-01-09T14:34:55","modified_gmt":"2017-01-09T05:34:55","slug":"swift-admob-interstitial%e8%a8%ad%e7%bd%ae%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blue-bear.jp\/kb\/swift-admob-interstitial%e8%a8%ad%e7%bd%ae%e6%96%b9%e6%b3%95\/","title":{"rendered":"[swift] ADMob Interstitial\u8a2d\u7f6e\u65b9\u6cd5"},"content":{"rendered":"<h2>ADMob Interstitial\u8a2d\u7f6e\u65b9\u6cd5<\/h2>\n<p>Google\u304c\u63d0\u4f9b\u3059\u308bMobile\u7528AD\u3001ADMob\u306eInterstitial\u3092\u8868\u793a\u3055\u305b\u308b\u65b9\u6cd5<\/p>\n<p>Interstitial\u306f\u30a2\u30d7\u30ea\u4e0a\u306b\u5168\u753b\u9762\u306e\u5e83\u544a\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n<p>\u4f7f\u3044\u6240\u3068\u3057\u3066\u306f\u30b2\u30fc\u30e0\u306e\u30af\u30ea\u30a2\u753b\u9762\u3084\u6b21\u306e\u30b9\u30c6\u30fc\u30b8\u306b\u9077\u79fb\u3059\u308b\u3068\u304d\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\uff1a<\/h3>\n<p>*\u524d\u63d0\u3068\u3057\u3066ADMob\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u5951\u7d04\u3084Interstitial\u5e83\u544a\u306eID\u4f5c\u6210\u306f\u7d42\u4e86\u3057\u3066\u3044\u308b\u3053\u3068\u3068\u3059\u308b<\/p>\n<pre>\r\nimport Foundation\r\nimport Firebase\r\n\r\n\r\nclass mainViewController: UIViewController,GADInterstitialDelegate{\r\n \r\n    var interstitial: GADInterstitial!\r\n    override func viewDidLoad() {\r\n        super.viewDidLoad()\r\n        let SIMULSTOR_ID = kGADSimulatorID \/\/ Simulator ID\r\n        let DEVICE_TEST_ID = \"aaaaaaaaaaaaaaaaa0123456789\"\/\/ \u5b9f\u6a5f\u30c6\u30b9\u30c8\u7528 ID \u3092\u5165\u308c\u308b\r\n        interstitial = GADInterstitial(adUnitID: \"ca-app-pub-xxxxx\/yyyy\") \/\/adUnitID\u3092\u5165\u529b\r\n        let request = GADRequest()\r\n        \/\/request.testDevices = [SIMULSTOR_ID] \/\/\u30c6\u30b9\u30c8\u7528\u306e\u3068\u304d\u306e\u307f\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3059\r\n        interstitial.loadRequest(request)\r\n        interstitial.delegate = self \/\/\u5e83\u544a\u306e\u30af\u30ed\u30fc\u30ba\u306a\u3069\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308c\u308bdelegate\u3092\u8a2d\u5b9a\r\n        if interstitial.isReady {\r\n            interstitial.presentFromRootViewController(self)\r\n        } else {\r\n            print(\"Ad wasn't ready\")\r\n        }\r\n\r\n    }\r\n\r\n\r\n    \/\/\u5e83\u544a\u304c\u9589\u3058\u3089\u308c\u305f\u3089\r\n    func interstitialDidDismissScreen(ad: GADInterstitial!) {\r\n        print(\"interstitialDidDismissScreen detected\")\r\n    }\r\n}\r\n<\/pre>\n<h3>\u6ce8\u610f\u4e8b\u9805\uff1a<\/h3>\n<p>interstitial.isReady\u3067\u5e83\u544a\u304c\u6e96\u5099\u3067\u304d\u3066\u3044\u305f\u3089\u8868\u793a\u3059\u308b\u3068\u4e0a\u306e\u30b3\u30fc\u30c9\u3067\u306f\u66f8\u304b\u308c\u3066\u3044\u308b\u304c\u3001<br \/>\n\u5b9f\u969b\u5e83\u544a\u304c\u6e96\u5099\u5b8c\u4e86\u3059\u308b\u307e\u3067\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306f\u5e83\u544a\u304c\u9593\u306b\u5408\u308f\u306a\u3044<\/p>\n<p>\u305d\u306e\u70ba\u3001\u524d\u91ce\u30da\u30fc\u30b8\u306a\u3069\u4e8b\u524d\u306binterstitial\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3066\u304a\u304d\u3001\u547c\u3073\u51fa\u3059\u3060\u3051\u306e\u72b6\u614b\u306b\u3057\u3066\u304a\u304f\u3068\u3088\u3044<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ADMob Interstitial\u8a2d\u7f6e<\/p>\n","protected":false},"author":1,"featured_media":88,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[90],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/768"}],"collection":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/comments?post=768"}],"version-history":[{"count":1,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/768\/revisions"}],"predecessor-version":[{"id":769,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/768\/revisions\/769"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media\/88"}],"wp:attachment":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media?parent=768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/categories?post=768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/tags?post=768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}