not good but great

プログラミング、アート、映画・本の感想について書きます。

Admobのインタースティシャル広告を出したいときはインスタンスを再生成する

Admobでinterstitial広告を出すために下のページを参考にしました。
http://lab.adn-mobasia.net/?p=3894

Interstitial ads  |  iOS  |  Google Developers

interstitial.loadRequest(GADRequest())

これで広告をロードするのだけど、インスタンス一つにつき表示は1回まで。

I'm getting the error "Request Error: Will not send request because interstitial object has been used".
Interstitials are a one time use object. You must allocate a new interstitial object to make another interstitial ad request.

ドキュメントを見ると上のように書いてある。

interstitial = GADInterstitial()

何度も表示させる場合は新しいインスタンスを作る必要がある。