InMobi Ads - Unity App - Using both banner and interstitial?

Technical | SDKs | MD_Reptile | Just now | 33 Replies | 4,138 Views

*

MD_Reptile

  • *
  • 13
  • 170 Points
InMobi Ads - Unity App - Using both banner and interstitial?
« On:November 25, 2016, 10:40:33 AM »
I am using Unity3D version 5.4.2f2 and the InMobi tizen ad SDK version 1117 from here:

https://developer.tizen.org/ko/development/tizen-studio/extension-sdk/inmobi-tizen-ad-sdk-programing-guide?langredirect=1

I am trying to get banner and interstitial ads to display properly in my tizen unity3d app. I based my C# script off the example script and I am trying to initialize both the banner and interstitial ads with their own site ID each.

This is how I do that in Unity C# - Have I made a mistake in the way I initialize the site ID's?:

Code: [Select]
using UnityEngine;
using Tizen.AdLib;
using System;

public class AdListener1 : BannerAdListener
{
    private AdProvider adobj;
    public AdListener1(AdProvider adobject)
    {
        adobj = adobject;
    }
    public void OnAdClicked(IntPtr handle, ErrorType error)
    {
        DebugConsole.DC.Log("Ad clicked B");
    }

    public void OnAdLoadFailed(IntPtr handle, ErrorType error)
    {
        adobj.BannerAdSetVisibility(handle, false); // the ad failed to load, make sure the banner isn't visible
        DebugConsole.DC.Log("Failed to load ad B: " + handle + " | " + error);
    }

    public void OnAdLoadSucceeded(IntPtr handle, ErrorType error)
    {
        adobj.BannerAdSetVisibility(handle, true); // the ad has loaded, show the banner
        DebugConsole.DC.Log("Succeeded to load ad B");
    }
}

public class AdListener : InterstitialAdListener
{
    public void OnAdClosed(IntPtr handle)
    {
        DebugConsole.DC.Log("Ad closed I");
    }

    public void OnAdLoadFailed(IntPtr handle, ErrorType error)
    {
        DebugConsole.DC.Log("Failed to load ad I: " + handle + " | " + error);
    }

    public void OnAdLoadSucceeded(IntPtr handle)
    {
        DebugConsole.DC.Log("Interstitial OnAdLoadSucceeded");
        AdProvider.Instance.InterstitialAdShow();
    }

    public void OnAdOpened(IntPtr handle)
    {
        DebugConsole.DC.Log("Ad opened I");
    }
}

public class AdHandler : MonoBehaviour {

    AdProvider adobject = AdProvider.Instance;

    string siteID = "ACTUAL_INMOBI_BANNER_SITE_ID"; // here I actually use the ID's given by inmobi, removed for privacy/security reasons
    string siteIDInterstitial = "ACTUAL_INMOBI_INTERSTITIAL_SITE_ID";


    // Use this for initialization
    void Start()
    {
        IntPtr handle;//, handle2;
        ErrorType result = adobject.InitAdlib(siteID, "_inmobi", "https://i.l.inmobicdn.net/sdk/jsac/p1/inmobi.js", "inmobi_conf");
        DebugConsole.DC.Log("Init adlib B: " + result);
        AdListener1 adListener_b = new AdListener1(adobject);

        result = adobject.InitAdlib(siteIDInterstitial, "_inmobi", "https://i.l.inmobicdn.net/sdk/jsac/p1/inmobi.js", "inmobi_conf");
        DebugConsole.DC.Log("Init adlib I: " + result);

        // INTERSTITIAL HANDLING
        AdListener adListener_i = new AdListener();
        adobject.AddInterstitialAd();
        adobject.InterstitialAdLoad();
        adobject.SetInterstitialAdListener(adListener_i);

        // BANNER BIG HANDLING
        //ErrorType result = adobject.AddBannerAd(BannerAdSize.BANNER_AD_SIZE_BIG, out handle1);
        //DebugConsole.DC.Log("Handle value:" + handle1 + " | " + result);
        //adobject.BannerAdLoad(handle1);
        //adobject.SetBannerAdListener(handle1, adListener_b);

        // banner small handling
        result = adobject.AddBannerAd(BannerAdSize.BANNER_AD_SIZE_SMALL, out handle);// 2);
        DebugConsole.DC.Log("Init banner:" + handle + " | " + result);// 2);
        adobject.BannerAdLoad(handle);// 2);
        adobject.BannerAdSetPosition(handle, BannerAdPosition.BANNER_AD_POS_BOTTOM_CENTER);
        adobject.SetBannerAdListener(handle, adListener_b);

        result = adobject.BannerAdSetRefreshInterval(handle, 60); // refresh every 60 seconds
        DebugConsole.DC.Log("Set refresh:" + handle + " | " + result);// 2);
    }

    void OnApplicationQuit()
    {
        ErrorType result = adobject.DeinitAdlib(siteID);
        DebugConsole.DC.Log("Quit app, deinit called: " + result);
    }
}

The problem is if I try and display these ads shortly after requesting them I get a white box instead of an actual ad, and through debugging I've discovered it reports "NO FILL" error from the plugin for the banner, and "INTERNAL ERROR" from the interstitial when I report back this information while testing on a remote device (samsung remote test lab) to a debug UI text. If I just leave showing the ads up to the "success" events for each ad type, then success never comes and the ad never shows it seems. You can see in this screenshot below what I am seeing exactly on the remote test device when it repeatedly tried to get a banner ad even using just the testing site ID (6eb8367d91c74369acca148f3441fe52) and initializing only that and trying to call these scripts:

https://i.gyazo.com/f2e0f25e285634ba1a0262ea11a0e61a.png

I'm curious if this is because there are too few ads ready to be displayed on tizen devices yet (considering the no fill error message) ? It is certainly possible I'm just doing something wrong here? Hope someone has some ideas for things to try differently to get this working!

Thanks for your time.
« Last Edit: November 25, 2016, 11:20:36 AM by MD_Reptile »



*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #1 On:November 25, 2016, 01:08:17 PM »
@MD_Reptile - I tried the sample code and was able to see All the Ads.
Even Interasterial or whatever its called.
I used the native C++ code not Unity.

Ads were displayed for me. May be for your country thers nothing available. But i dont agree with it too.

May be you should contact InMobi help by email-  tizen.ads@samsung.com
They will surely provide all the technical help.




Aashish

*

MD_Reptile

  • *
  • 13
  • 170 Points
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #2 On:November 25, 2016, 10:42:16 PM »
I did email them on the 19th and have not heard back, so I came here.

*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #3 On:November 26, 2016, 10:19:29 AM »
@MD Reptile - I think you should signup/register configure your account for google's ad network and others too.
That will make ads from google Ads platform available for you in your country.


Aashish

*

MD_Reptile

  • *
  • 13
  • 170 Points
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #4 On:November 26, 2016, 10:22:15 AM »
I have not been aware of any other platforms which support tizen (and unity3d game engine) - if anybody knows of other networks that support tizen please let me know!

*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #5 On:November 26, 2016, 12:44:03 PM »
I have not been aware of any other platforms which support tizen (and unity3d game engine) - if anybody knows of other networks that support tizen please let me know!
MD Reptile - Which country are you from ?
This is Aggregated network. You can add Google's AdMob to it. Thats it.

However if you have problems of Unity and InMobi then you will have to solve it anyhow.

I am unable to guess where the problem could be.
BTW the InMobi Registration is free. Give it a Try. I am sure you will see Ads when you register with them and configure AdMob with it. I read they support one another Ad's network too. If i am not wrong.



Aashish
« Last Edit: November 26, 2016, 12:45:50 PM by patash »

*

MD_Reptile

  • *
  • 13
  • 170 Points
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #6 On:November 26, 2016, 05:11:16 PM »
For now, InMobi handles the setup of your site ID's and account manually on their end. I do not set up anything personally, such as mediation of other networks (although I haven't tried logging in to do that stuff) and just use the site ID's they gave me, and the SDK they provided samsung at the site in the first post.

Any chance I could get somebody with Unity3d to test this and report back if the sample site ID produces ads for them?

*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #7 On:November 26, 2016, 05:55:24 PM »
As i have already mentioned the sample siteID did worked for me. It works in INDIA.
I was able to see all three types of AD's.
And sorry i dont have Unity3D . So sorry.


Aashish
« Last Edit: November 26, 2016, 06:12:12 PM by patash »

*

MD_Reptile

  • *
  • 13
  • 170 Points
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #8 On:November 26, 2016, 06:05:17 PM »
Did you use unity3d and the plugin?

*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #9 On:November 26, 2016, 06:14:33 PM »
I used Tizen Studio and Tizen SDK. Native.
However if the InMobi SDK is used in my own App sourceCode then the code fails to compile.

Aashish

*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #10 On:November 28, 2016, 11:39:10 PM »
MD Reptile - I have also written email to them and haven't here from them. So same story here. Andy response to your email from their side ?
Hope we get some other Ad network soon...


Aashish

*

MD_Reptile

  • *
  • 13
  • 170 Points
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #11 On:November 29, 2016, 01:03:38 AM »
MD Reptile - I have also written email to them and haven't here from them. So same story here. Andy response to your email from their side ?
Hope we get some other Ad network soon...


Aashish

I have written back and forth a couple times with them, and haven't gotten a whole lot of useful information yet. It takes a couple days at least before they get back it seems. Anyway I haven't made any progress, other than finding out that India seems to be the only place where ads serve right this moment probably because of demand. I would really love someone with Unity3d (or someone willing to download) to test this unity plugin and run the sample site ID or their own, and report back if they get successful ads presented or not on an India based IP (the RTL has devices there). I personally haven't had any luck, going to try again later today.

*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #12 On:November 29, 2016, 01:44:55 AM »
I have written back and forth a couple times with them, and haven't gotten a whole lot of useful information yet. It takes a couple days at least before they get back it seems. Anyway I haven't made any progress, other than finding out that India seems to be the only place where ads serve right this moment probably because of demand. I would really love someone with Unity3d (or someone willing to download) to test this unity plugin and run the sample site ID or their own, and report back if they get successful ads presented or not on an India based IP (the RTL has devices there). I personally haven't had any luck, going to try again later today.
MD Reptile - http://mobile-site.pl/how-i-monetize-for-tizen/
Please let me know if this works for u...  :)


Aashish

*

patash

  • ****
  • 489
  • 5845 Points
  • Tizen is better than iOS.
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #13 On:December 02, 2016, 09:38:50 AM »
MD Reptile - I received an email from InMobi to install the SDK. From Package Manager - Extension SDK - Add the sdk from the downloaded file "inmobi-tizen-adsdk_1.0.0.zip".
Then create Native(for me) project and add -
4.  Under C/C++ Build->Settings -> C++ Linker->Libraries click on  and give the name of library as "adlib" and select ok.
5.  Now in the source file where ever adlib apis are being called, #include <adlib.h> to use the functions and datatypes of adlib.
 

Hope this helps you.
Aashish

*

MD_Reptile

  • *
  • 13
  • 170 Points
Re: InMobi Ads - Unity App - Using both banner and interstitial?
« Reply #14 On:December 02, 2016, 09:42:17 AM »
MD Reptile - I received an email from InMobi to install the SDK. From Package Manager - Extension SDK - Add the sdk from the downloaded file "inmobi-tizen-adsdk_1.0.0.zip".
Then create Native(for me) project and add -
4.  Under C/C++ Build->Settings -> C++ Linker->Libraries click on  and give the name of library as "adlib" and select ok.
5.  Now in the source file where ever adlib apis are being called, #include <adlib.h> to use the functions and datatypes of adlib.
 

Hope this helps you.
Aashish

This is similar to how the unity setup works. I've found a unity developer who is helping test from their end to see if it works, so I hope soon to fix this problem.

 


Facebook Comments