gpt4 book ai didi

ios - 使用 Swift 和 SpriteKit 实现 Applovin 广告

转载 作者:行者123 更新时间:2023-11-28 09:05:14 24 4
gpt4 key购买 nike

我需要一些有关使用 Swift 集成来自 Applovin 的插页式广告的帮助。目前,我已经成功集成了 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")
}

最佳答案

您可能需要在 AppLovin 控制面板中为您的应用启用“测试模式”,以强制为您所在的区域转换测试广告。如有任何问题,请发送至 support@applovin.com 以获得进一步帮助。

关于ios - 使用 Swift 和 SpriteKit 实现 Applovin 广告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30982551/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com