Search code examples
c++qtqmlcross-platformads

Qt cross-platform mobile ADS support?


I have a mobile app developed in Qt.

Is there a way to support ads with Qt?

Thanks in advance!


Solution

  • There's a cool, newly released, first party Advertising library from Qt.

    To use it:

    1. be sure you have Qt 5.15.0 or higher installed (up to 6.2.2).
    2. Install Qt Digital Advertisement plugin from either the installer or from the Maintenance Tool of your already installed Qt environment.
    3. Copy the profile.dat and configMobile.dat files in your root project (these files will be created specially for your account, and handed over to you from the Qt team)
    4. Edit your qml.qrc project file to include both of the files from point 3.
            ...
            <file>profile.dat</file>
            <file>configMobile.dat</file>
        </qresource>
    
    1. Place the MobileAd qml view inside your screen qml. And you're all done!

    For now Qt has a single MobileAd qml component, that can be manipulated at your own desire and from which you can create:

    • Banner (Anchor) ads
    • Interstitial (Fullscreen) ads
    • Native (Inline) ads

    In the near future the library will also support Rewarded ads.

    For more details please follow the documentation or blog posts.