AdMobへの登録して広告を表示
まだ、アプリを公開とかは考えていないけど
とりあえず実機でみれるか確認だけ
admobに登録
http://www.google.co.jp/ads/admob/
googleアドセンスとかにも登録しておく必要があるみたい
収益
収益化を選択
アプリを指定する
広告の種類の設定を行う
完了
アプリ設定
ソースに設定
<script> ons.ready(function() { // Set AdMobAds options: admob.setOptions({ publisherId: "コピーした広告IDを設定する", // Required interstitialAdId: "", // Optional tappxIdiOs: "", // Optional tappxIdAndroid: "", // Optional tappxShare: "" // Optional }); // Start showing banners (atomatic when autoShowBanner is set to true) admob.createBannerView(); // Request interstitial (will present automatically when autoShowInterstitial is set to true) admob.requestIntertitial(); }); </script>
※今回はonsen-uiなのでons.ready内部に記載しました
結果
なんかそれっぽいのがでました
所感
広告の内容はともかく出し方は以外と簡単でした。
どうするかは今後検討してみる。