I am developing an app with Flutter and I'd like to add an interstitial ad on the startup. On Android I have no problem at all, on ios I get the following error in console:
<Google> To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ kGADSimulatorID ];
<Google> Invalid application ID. Follow instructions at https://developers.google.com/admob/ios/quick-start#initialize_mobile_ads to find your app ID in the AdMob UI.
Syncing files to device iPhone 11 Pro Max...
), error=(null) on <SOConfigurationClient: 0x600002a734c0>
flutter: InterstitialAd MobileAdEvent.loaded
[C2.1 0EC72EE0-6FAB-4A1B-85DF-1CB19917031B 192.168.0.13:56426<->77.192.211.175:443/5228]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 0.082s, DNS @0.002s took 0.006s, TCP @0.010s took 0.011s, TLS took 0.042s
bytes in/out: 3897/1515, packets in/out: 4/3, rtt: 0.010s, retransmitted packets: 0, out-of-order packets: 0
path: satisfied (Path is satisfied), interface: en0
[C3.1 0EC72EE0-6FAB-4A1B-85DF-1CB19917031B 192.168.0.13:56427<->77.192.211.175:443/5228]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 0.196s, DNS @0.000s took 0.003s, TCP @0.005s took 0.014s, TLS took 0.031s
bytes in/out: 1935140/1521, packets in/out: 1349/3, rtt: 0.014s, retransmitted packets: 0, out-of-order packets: 0
[C4.1 0EC72EE0-6FAB-4A1B-85DF-1CB19917031B 192.168.0.13:56429<->77.192.211.175:443/5228]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 0.161s, DNS @0.001s took 0.002s, TCP @0.003s took 0.011s, TLS took 0.040s
bytes in/out: 879686/1527, packets in/out: 614/3, rtt: 0.011s, retransmitted packets: 0, out-of-order packets: 0
Syncing files to device iPhone 11 Pro Max... 11,248ms (!)
I have linked the app to Firebase and AdMob and in fact, I put the app id (found on AdMob) in the Info.plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-6112659362985719~7627685066</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
...
...
...
Also, here you can find the code of the AppDelegate.swift:
import UIKit
import Flutter
import Firebase
import GoogleMobileAds
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
var interstitial: GADInterstitial!
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure()
GADMobileAds.sharedInstance().start(completionHandler: nil)
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
as specified in the Google quick start guide. I have put in the project the GoogleService-Info.plist downloaded by Firebase.
I have added the following dependencies to the PodFile:
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Analytics'
pod 'Google-Mobile-Ads-SDK'
Finally, I have added the google frameworks as specified in the quick started guide here
I think I did everything but still I have the highlighted error. Am I missing something?