I have been trying to follow this documentation in order to implement appodeal ads inside of my iOS app.
https://docs.appodeal.com/ios/get-started
I have everything (That I know of) successfully initialized but when I try to display a test banner ad, I am not seeing anything. Here is the code That I am trying to use to get started.
public struct AppodealConstants {
static let key: String = "myAppKey"
static let adTypes: [AppodealAdType] = [.interstitial, .banner]
static let testMode: Bool = true
}
private func initializeAppodealSDK() {
Appodeal.setAutocache(true, types: [.banner, .interstitial])
Appodeal.setTestingEnabled(AppodealConstants.testMode)
Appodeal.setInitializationDelegate(self)
Appodeal.initialize(withApiKey: AppodealConstants.key, types: [.banner, .interstitial])
}
extension AppDelegate: AppodealInitializationDelegate {
func appodealSDKDidInitialize() {
print("Appodeal has finished initializing.")
print("Is Appodeal initialized for banner ads? (Appodeal.isInitialized(for: .banner))")
}
}
Main ViewController to display banner ad
override func viewDidLoad() {
super.viewDidLoad()
Appodeal.setBannerDelegate(self)
requestBannerAd()
}
func requestBannerAd() {
let placement = "bannerAd"
if Appodeal.isInitialized(for: .banner) {
if Appodeal.canShow(.banner, forPlacement: placement) {
print("Showing banner ad for placement: (placement)")
Appodeal.showAd(.bannerBottom, forPlacement: placement, rootViewController: self)
} else {
print("Cannot show banner ad for placement: (placement). Ad might not be available.")
}
} else {
print("Appodeal is not initialized for banner ads.")
}
}
func appodealBannerDidLoadAd() {
print("Banner ad loaded successfully")
}
func appodealBannerDidFailToLoadAd() {
print("Failed to load banner ad")
}
func appodealBannerDidShowAd() {
print("Banner ad shown")
}
func appodealBannerDidHideAd() {
print("Banner ad hidden")
}
func appodealBannerDidClick() {
print("Banner ad clicked")
}
In my logs, I see
Appodeal is not initialized for banner ads.
Appodeal has finished initializing.
Is Appodeal initialized for banner ads? true
Has anyone tried this before?