我想添加谷歌移动Interstitial广告,我得到了错误。我如何添加谷歌Interstitial广告?
到目前为止,我的情况如下:
var interstitial: GADInterstitial!
func createAndLoadAd() -> GADInterstitial
{
var ad = GADInterstitial()
ad.adUnitID = "ca-app-pub-5378899862041789/8532100959"
var request = GADRequest()
ad.loadRequest(request)
return ad
}发布于 2015-05-08 19:18:05
间质代码:
导入GoogleMobileAds框架并将代理设置为查看:
import GoogleMobileAds
class ViewController: UIViewController, GADInterstitialDelegate声明:
var interstitial:GADInterstitial?职能:
//Interstitial func
func createAndLoadInterstitial()->GADInterstitial {
var interstitial = GADInterstitial(adUnitID: "ca-app-pub-5378899862041789/8532100959")
interstitial.delegate = self
interstitial.loadRequest(GADRequest())
return interstitial
}函数调用:
interstitial = createAndLoadInterstitial()添加委托方法以加载广告。
添加SDK需要的其他框架()
SDK依赖于以下iOS开发框架,这些框架可能还不是项目的一部分:
AdSupport
AudioToolbox
AVFoundation
CoreGraphics
CoreMedia
CoreTelephony
EventKit
EventKitUI
MessageUI
StoreKit
SystemConfiguration对于更新的选项,请按照谷歌提供的步骤执行。
https://stackoverflow.com/questions/30131159
复制相似问题