SDK Integration

Overview

Consoliads SDK is a Unity SDK integrated with the most number of ad networks which eliminates the requirement to integrate different Ad Network SDKs into your application, simultaneously, to maximize revenue. Just integrate Consoliads SDK and simply configure it in your unity project to show Ads of different Ad Networks.

Next you can configure your application online and manage Ads in the Admin Panel Dashboard of ConsoliAds
You can always optimize your ads to increase revenue depending on the stats visible in your admin panel. It enables you to change, manage and disable ads for effective intelligence. Make changes, and get to know which combination of ads gives you the best revenue.

ConsoliAds SDK has a simple inspector view in unity. It enables you to just fill up the information that is required and make it work without any complications.

To add ConsoliAds SDK to your games promptly, you just need to take care of a few constituents:

  • A ConsoliAds Account
  • Latest ConsoliAds SDK
  • Unity Installed

Setting up SDK

Download SDK

Download the latest ConsoliAds SDK from your admin panel in help

Save it in your computer

Import SDK

  • Open your Unity Project
  • Open ConsoliAds SDK You Downloaded
  • A Dialog box will appear
  • Click Import button to import ConsoliAds SDK into your project

Add prefab to your scene

Now in your project explorer Go to “Assests\ConsoliAds\Prefabs” or search for “ConsoliAds.prefab”; drag and drop it into your scene

Fill up Information

  • In the hierarchy tab select the ConsoliAds game object
  • Next in the Unity Inspector view of ConsoliAds game object
  • You need to fill up the required information
  • First you need to enter your user signature (for your verification).
    You can get this by:
    • Signing in to your ConsoliAds account
    • Then going into your Personal Info by clicking on your name in the right corner of the top bar and there you will have an interface containing your personal user signature
    • Put that user signature in the ConsoliAds Inspector view in unity
  • After you have followed the previous steps successfully, enter your Application Name in the Product Name option
  • Select your Application Platform (Google, Apple, Windows)
  • Next you need to Enter your application's unique Package name in the Bundle Identifier field
  • (Optional) You can enter your application's version in the Bundle Version option

Creating Scene List

  • In Your ConsoliAds Inspector
  • You will see an expandable option for Scene List
  • Click on that and you will see a field "Size"
  • In the "Size" field enter the number of scenes (places to show ads) you want in your application and press Enter
  • According to your given size, expandable scene elements will be created in which you will further need to specify the certain ad networks you want to show in each scene element

Specifying Scene Details

  • After Creating Scene List you will need to specify ad networks to show in those scenes
  • Click on a Scene Element you previously created. For example Element 0
  • You will see 4 options
    • Scene Type
    • Ad Network List
    • Fail Over
    • Skip First
  • Scene Type is the specific application scene in which you want your ads to appear
  • Ad Network List is the list of Ads from those Ad Networks to show in this Scene Element
  • Fail over is the ad to show if any of the sequence ads failed to show
  • Skip first is a check to skip ad in a first game play

Specifying Ad Network List

  • Click on the Ad Network List option
  • You will see a size option
  • in this size option give the number of ad Networks you want to show in this Scene and press Enter
  • For example 3 is given in the following image
  • After pressing Enter, Ad Network List will form depending upon the given size
  • Each element of the list is a drop down
  • Just select the name of an ad Network

Add/Remove Ad Networks

  • If you see this error on Configure Server refer to the documentation on how to Add/Remove ad networks from Consoliads plugin

Pre-Loaded Assets Settings

  • Make sure that in Pre-loaded assets -> stripping level should be selected as Disabled

Configuring Server

  • Next at the bottom of the inspector there is a button to configure server
  • Click on the button and your Application will be configured with the online server
  • If your application does not exist on server, it will be created with the details you’ve provided
  • The Scene list you have specified with ad list and other parameters will be added or overwritten on server
  • If your scene list size and names are same, nothing will be overwritten and scene settings from server will be overwritten in unity
  • Ad Ids will be fetched from server, if not present on server then the ones you added in unity inspector will be used

Showing Ads

  • In Your application where you want to show a Scene
  • you will need to write code given below:
  •                             ConsoliAds.Instance.ShowAd (0);
                                
  • In the above Code ShowAd method has a parameter 0 i.e. the Scene Element Number
  • Similarly, you will use this method to show other Scenes
  •                             ConsoliAds.Instance.ShowAd (1);
                                
  • and the Ad Network List in that Scene will be shown one after another

Hiding Ads

  • If you want to hide all ads
  • you will need to write the following code
  •                             ConsoliAds.Instance.hideAllAds();
                                
  • You only need to call this function once in your script and whenever user starts your application ads will not show

Using Interstitial And Video

  • From ConsoliAds Unity Inspector you need to do the following steps:
  • Skip First (enable/disable).
  • Enter the size of network list.
  • Select the network provider on each list.
  • Select the fail over ad network.



  • To show interstitial you need to use the following code in your desired script:
  •                             ConsoliAds.Instance.ShowInterstitial(int sceneIndex);
                                

Using Rewarded Video

  • From ConsoliAds Unity Inspector you need to do the following steps:
  • Skip First (enable/disable).
  • Enter the size of network list.
  • Select the network provider on each list.
  • Select the fail over ad network.



  • To show Rewarded video you need to use the following code in your desired script:
  •                             ConsoliAds.Instance.ShowRewardedVideo(sceneID); 
                                

Using Admob Banner

  • From ConsoliAds Unity Inspector you need to do the following steps:
  • Enable/Disable Admob Banner
  • Select Admob Banner Size
  • Select Admob Banner Position



  • To show Admob Banner you need to use the following code in your desired script:
  •                                 ConsoliAds.Instance.ShowBanner(int sceneIndex);
                                
  • To hide Admob Banner you can use this code:
  •                                 ConsoliAds.Instance.HideBanner();
                                

Using Admob Native

  • From ConsoliAds Unity Inspector you need to do the following steps:
  • Enable/Disable Admob Native
  • Set width and height
  • Select Admob Native Position.



  • To show Admob Native you need to use the following code in your desired script:
  •                             ConsoliAds.Instance.LoadNativeAd(int sceneIndex) ;
                                
  • To hide Admob Native you can use this code:
  •                             ConsoliAds.Instance.HideNativeAd();
                                

Hiding Ads

  • If you want to hide all ads
  • you will need to write the following code
  •                             ConsoliAds.Instance.hideAllAds();
                                
  • You only need to call this function once in your script and whenever user starts your application ads will not show

Using More App URL and Support Email

  • The more apps URL and support email are added in a particular brand setting.
  • When an application of that brand is configured with the unity SDK, the more apps URL and support email are available to use.
  • To access more apps URL, use
    consoliads.Instance.MoreFunURL()
    It will return the more apps URL you added in the admin panel.
  • To access support email, use
    consoliads.Instance.SupportEmail()

Implementing CallBack Events

  • ConsoliAds Implements Single CallBack Event for all Ad Networks
  • You can implement these callback events to listen to Ad Networks Impression Calls
  • In the Start() method of your script use the following code to attach your functions with ConsoliAds CallBack Events:

  •                             ConsoliAds.onInterstitialAdShownEvent += onInterstitialAdShown;
    ConsoliAds.onVideoAdShownEvent += onVideoAdShown;
    ConsoliAds.onRewardedVideoAdShownEvent += onRewardedVideoAdShown;
    ConsoliAds.onPopupAdShownEvent += onPopupAdShown;

  • An example has been given in the Sample script

Checking for ad availability

  • you can check if ad is available before showing it
  • you have to pass the scene index on which you want to check ad availability
  • this method returns a Boolean depending on availability

  •                             ConsoliAds.Instance.IsAdAvailable(int sceneIndex);

Coppa compliance, child directed

  • There is a checkbox for child direct apps in unity inspector, if your app falls under coppa compliance i.e. for children under 13, you should check it
  • when you configure server with child directed check, it will update on server and can be changed from there as well

Support for unity 4.x.x

  • Unity 4 does not support subdirectories in plugins folder, Therefore, you have to relocate your files from:
    Plugins/iOS/subdirectories
    to the root folder:
    Plugins/iOS
  • Learn more about Heyzap support for unity 4 (IOS Specific) here
  • You will not be able to use ConsoliAds Prefab in unity 4. Therefore, you have create a new Game Object in your scene and attach
    consoliads.cs
    script with it and then save that object as a prefab.

Developing for IOS

Support for unity 5.x.x

  • Set target minimum IOS version to 7.0
  • If you have made an Xcode build on a MAC, you may need to remove
    libPods.a
    file from your frameworks folder.
  • In your Xcode project, select your target Build Settings and make sure that you have added the following flag in "Other linker Flags"
    -ObjC
  • In your Xcode project, select your target Build Settings and
    • Disable Bitcode option
    • Enable module option (c and objective-c)

  • In your Xcode project, select your target Build Phases and add this flag "-fno-objc-arc"
    In these files (please remove double quotes when adding)
    • RevmobUnityiosBinding.m
    • ChartBoostBinding.m
    • ChartBoostManager.mm
  • In your Xcode project open "ConsoliResources.bundle" and find the info.plist inside this bundle
    Find the following key in this info.plist and please remove this key and its value
    • Executable file


  • If you have made an Xcode build on a Windows PC, you may have to perform the following steps:
  • Make sure that the following libraries and frameworks are linked to your project.
    if they are not automatically included, you need to manually add them.

  •                             libz.1.2.5.tbd
    libz.tbd
    libxml2.tbd
    libobjc.tbd
    libsqlite3.tbd

    AddressBook.framework
    AddressBookUI.framework
    SystemConfiguration.framework
    QuartzCore.framework
    MessageUI.framework
    MobileCoreServices.framework
    MediaPlayer.framework
    EventKitUI.framework
    EventKit.framework
    CoreData.framework
    CoreVideo.framework
    CoreMotion.framework
    CoreMedia.framework
    CoreTelephony.framework
    CoreText.framework
    CoreGraphics.framework
    AVFoundation.framework
    AVKit.framework
    AudioToolbox.framework
    AdSupport.framework
    Social.framework
    StoreKit.framework
    Webkit.framework