我想要一些帮助整合从Applovin使用Swift的间质广告。目前,我已经成功地集成了SDK并使用ALSdk.initializeSdk()初始化了它。我的项目目录中有一个名为Applovin的文件夹,它包含:headers文件夹(包含所有.h文件)和libApplovinSdk.a。
我有一个BridgingHeader.h文件,在其中导入相关的框架
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <Chartboost/Chartboost.h>
#import <Chartboost/CBNewsfeed.h>
#import <CommonCrypto/CommonDigest.h>
#import <AdSupport/AdSupport.h>
#import <AVFoundation/AVFoundation.h>
#import<CoreTelephony/CTCallCenter.h>
#import<CoreTelephony/CTCall.h>
#import<CoreTelephony/CTCarrier.h>
#import<CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreGraphics/CoreGraphics.h>
#import <CoreMedia/CoreMedia.h>
#import <MediaPlayer/MediaPlayer.h>
#import <SystemConfiguration/SystemConfiguration.h>
// Core SDK
#import "ALErrorCodes.h"
#import "ALSdk.h"
#import "ALSdkSettings.h"
#import "ALTargetingData.h"
#import "ALPostbackService.h"
#import "ALPostbackDelegate.h"
// Standard Ads
#import "ALAd.h"
#import "ALAdDisplayDelegate.h"
#import "ALAdLoadDelegate.h"
#import "ALAdRewardDelegate.h"
#import "ALAdService.h"
#import "ALAdSize.h"
#import "ALAdType.h"
#import "ALAdUpdateDelegate.h"
#import "ALAdVideoPlaybackDelegate.h"
#import "ALAdView.h"
#import "ALIncentivizedInterstitialAd.h"
#import "ALInterstitialAd.h"
// Native Ads
#import "ALNativeAd.h"
#import "ALNativeAdService.h"
#import "ALNativeAdPrecacheDelegate.h"
#import "ALNativeAdLoadDelegate.h"在我的AppDelegate中,我有以下方法,我需要在这些方法中放入什么?
func adService(adService: ALAdService, didLoadAd ad: ALAd) {
}
func adService(adService: ALAdService, didFailToLoadAdWithError code: Int32) {
}我试图用下面的代码显示广告,但是ALInterstitialAd.isReadyForDisplay()总是错误的,我可能遗漏了一些非常明显的东西,但我不知道它是什么,任何帮助都是非常感谢的,谢谢!
if ALInterstitialAd.isReadyForDisplay() == true {
ALInterstitialAd.show()
} else {
println("No Applovin Ad available to show")
}发布于 2015-06-22 17:07:02
您可能需要在AppLovin仪表板中为您的应用程序启用“测试模式”,以便强制测试广告为您的区域服务。请将任何问题发送到support@applovin.com寻求进一步的帮助。
https://stackoverflow.com/questions/30982551
复制相似问题