【问题标题】:Implementing Applovin Ads with Swift & SpriteKit使用 Swift 和 SpriteKit 实现 Applovin 广告
【发布时间】:2015-06-22 14:28:46
【问题描述】:

我需要一些关于使用 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")
    }

【问题讨论】:

    标签: ios swift applovin


    【解决方案1】:

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

    【讨论】:

    • 是的,就是这样。谢谢
    • 我遇到了同样的问题,但打开测试模式似乎不是答案,因为发布应用程序时不会开启。如果我忽略 isReadyForDisplay 标志,它将强制加载并显示广告。如果不是在测试模式下,为什么它不会在后台加载广告?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-19
    • 2022-08-14
    相关资源
    最近更新 更多