Hive AdKit for ADOP: C++

Hive AdKit for ADOP (hereinafter, AdKit for ADOP) is an advertisement module that uses ADOP‘s API and develops by following the guideline from ADOP. Using AdKit with Hive SDK, log data is sent to Hive Analytics server so that you can skip analyzing an advertisement.

This guide explains how to implement AdKit for ADOP with Cocos C++ so that the Hive SDK user uses ADOP under the c++ development environment. AdKit for ADOP with C++ is able to run on the iOS and Android platforms, and you can see how to set for each on this page.

Creating Development Environment

Follow the guide below for each platform to configure AdKit.

  • Android
    Build the Hive AdKit SourceCode embedded in SDK to use the Hive AdKit. Android Studio 4.2 and later version are recommended.

    1. ExternalNativeBuild
      Using #cmake, add the following code to the CMakeList.txt file.
    2. Add the following code to the build.gradle file.
    3. Add AdMobId, which is formatted in caapppubXXXXX~YYYYY, to the AndroidManifest.xml file.
  • iOS
    Build the Hive AdKit SourceCode embedded in SDK to use the Hive AdKit.

    1. Drag and drop the HIVEAdKit/src and HIVEAdKit/include folders to XCode project.
      • Include all files with .cpp, .hpp and .mm extensions.
      • Hive AdKit provides bridge-pattern code for the actual use.
    2. Add HIVEAdKit/include/bidmad to Project > BuildSetting > Search Paths.
    3. Add GADApplicationIdentifier to Info.plist of the Xcode project generated in Unity build, and enter AdMobId, which is formatted in ca-app-pub-XXXXX~YYYYY, as string type.
      On iOS 14 and higher, add SKAdNetworkItems to Info.plist.
    4. Add the following to CocoaPods settings.
    5. Run the following to apply CocoaPod settings.

 


How to Use

Test Ad Key in ADOP

Using a test ad key that ADOP issued is required.

Initializing Hive AdKit

If your app is targetting the users in the European Economic Area (EEA) and the UK, you have to obtain GDPR consent. Go to the UserMessagingPlatform Library of Google AdMob and follow the guide to get the consent.

Reward ads

Rewarded ads reward a user who watched a video for a period of time, and is able to load one ad at a time.

Interstitial ads

Interstitial ads are full-screen ads that cover the interface of game.

Adaptive Banner ads

Adaptive Banner ads are a type of rolling banner that occupies a spot on screen. The banner’s position is adjustable with the yPos value.

Test Ads

It is important for advertiser not to be charged when test ad is clicked in development. If you click ads too much out of test mode, it is regarded as invalid action. Therefore, be aware not to be a target account to report. Refer to the Google Developers to use a test ad.