Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidCode SnippetComponentDelphiDemoFiremonkeyIOS

Easily Add Advertising To Your Apps With Delphi XE6 Firemonkey On Android And IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE6 Firemonkey Iad AdMob BannerAd Example | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSMarco Cantu from Embarcadero has a blog post up where he shows how simple it is to use the new TBannerAd component for Delphi XE6 Firemonkey. TBannerAd wraps the AdMob API for Android and the Iad API for IOS so it is cross platform which means you can use one component and it works on both platforms. It may actually be harder to setup the account information that you need to be able to use AdMob and IOS than it is to actually implement the ads within your app. Using the component is as simple as setting the AdUnitID property and calling the LoadAd method. It also appears that TBannerAd has a TestMode property which corresponds to the TestMode option in the Android SDK. There is more information about the TBannerAd functionality over in the XE6 documentation called Adding Advertising To Your Mobile Apps. Keep in mind that TBannerAd looks like it really only implements a standard banner and doesn’t support interstitials that I can see. Interstitials are where the money is at in my experience so you will need to get a third party library to implement that in your app. The last thing you need to get the banner ads running on Android is to add a section to your Android manifest. It should look like this:
<activity android:name="" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
And finally a tip from the Embarcadero Firemonkey forum concerning an error you may receive from TBannerAd on IOS. If you get this error: “ObjectiveC-class ADBannerView not found” then “You have to add “-framework iAd” to the LD Linker commands in the project-options.” according to Oliver S.

Update: Marco has another blog post here where he talks about the Linker issue. He recommends adding iAd and StoreKit like this “-framework iAd -framework StoreKit”.

Head over and read the full blog post from Marco Cantu where he demonstrates TBannerAd In Delphi XE6.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging


Unleashing Creativity With Song Writer AI: A Deep Dive


How To Build Stable Diffusion Text To Image Prompts


FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

Leave a Reply