Languages

Menu
Sites
Language
admobi intertetial problem in Unity3d game

Whenever i execute AdProvider.Instance.InterstitialAdShow(); , blank white page shown instead of interstetial ad, thats my script.


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Tizen.AdLib;
using System;
using UnityEngine.UI;


publicclassAdListener1:BannerAdListener
{
privateAdProvideradobj;
publicAdListener1(AdProvideradobject)
{
adobj=adobject;
}
publicvoidOnAdClicked(IntPtrhandle)
{
}

publicvoidOnAdLoadFailed(IntPtrhandle,ErrorTypeerror)
{

}

publicvoidOnAdLoadSucceeded(IntPtrhandle)
{
//adobj.BannerAdSetVisibility(handle,true);
}
}

publicclassAdListener:InterstitialAdListener
{
publicvoidOnAdClosed(IntPtrhandle)
{
AdProvider.Instance.InterstitialAdLoad();
}

publicvoidOnAdLoadFailed(IntPtrhandle,ErrorTypeerror)
{
AdProvider.Instance.InterstitialAdLoad();
}

publicvoidOnAdLoadSucceeded(IntPtrhandle)
{
Debug.Log("EnteredtoOnAdLoadSucceeded");

AdController.isInterstetialLoaded=true;


//AdProvider.Instance.InterstitialAdShow();
}

publicvoidOnAdOpened(IntPtrhandle)
{

}
}

publicclassAdController:MonoBehaviour{


publicstaticboolisInterstetialLoaded;
AdProvideradobject=AdProvider.Instance;


voidAwake()
{
DontDestroyOnLoad(this);

if(FindObjectsOfType(GetType()).Length>1)
{
Destroy(gameObject);
}
}

voidStart(){
isInterstetialLoaded=false;
IntPtrhandle,handle2;
adobject.InitAdlib("2cabe3d102f112345a93f608a082c0c3","_inmobi","https://i.l.inmobicdn.net/sdk/jsac/p1/inmobi.js","inmobi_conf");
Debug.Log("Enteredintostart");
AdListener1adListener_b=newAdListener1(adobject);
AdListeneradListener_i=newAdListener();
adobject.AddInterstitialAd();
adobject.InterstitialAdLoad();
adobject.SetInterstitialAdListener(adListener_i);
ErrorTyperesult=adobject.AddBannerAd(BannerAdSize.BANNER_AD_SIZE_BIG,outhandle);
Debug.Log("Handlevalue:"+handle);
adobject.BannerAdLoad(handle);
result=adobject.AddBannerAd(BannerAdSize.BANNER_AD_SIZE_SMALL,outhandle2);
Debug.Log("Handlevalue:"+handle2);
adobject.BannerAdLoad(handle2);
adobject.BannerAdSetPosition(handle2,BannerAdPosition.BANNER_AD_POS_TOP_CENTER);
adobject.SetBannerAdListener(handle,adListener_b);
adobject.SetBannerAdListener(handle2,adListener_b);
}///


publicvoidShowAdClick()
{

if(isInterstetialLoaded==true){

isInterstetialLoaded=false;
AdProvider.Instance.InterstitialAdShow();

}
}

publicvoidQuit()
{
adobject.DeinitAdlib();
Application.Quit();

}
}

View Selected Answer

Responses

23 Replies
Anirban Dutta

Hi!

Did you add TizenAdLibAsset plugin properly ? Also, there are some constratints like: 

1. Device: z1 and z3 are not supported yet.
2. Emulator is not supported yet.

If other constraints are checked properly but the problem remains you can mail to  tizen.ads@samsung.com for ad related issues. They have mentioned  it at InMobi Tizen Ad SDK Programing Guide.

Thanks.

king

I have tested on Z3 with the sample native app provided in package and it works.  Are you sure that it doesnt work on Z1 and Z3??

Anirban Dutta

Device constraints are for Tizen ad id feature. Device z1 and z3 are not supported in India untill updated to new firmware. Test site id may work. I have seen faq and related comments here: https://samsung.tizenforum.com/application-development/monetize-your-tizen-apps-with-inmobi-tizen-ads-sdk/

I tried to test sample app on z3 but Ad doesn't work at all . Do inmobi ads work outside of India ? I found in tizenforum that they don't show up. 

Thanks.

king

You are talking about two different things.  AdId and Site Id are two different things. AdId is read from device where as SiteId is from InMobi.

I agree AdId is not existing for Z1 and Z3 devices but it doesnt restrict it from fetching the ads.  In web application we can see that the adid is initialized to "00000000-0000-0000-0000-000000000000".  So i hope even if adid feature is not existing in the device, this default value will be sent to fetch the ads.

I have double checked in Z3 and the ads are fetched.

king

Hi Ashad,

 

I can see in your code that you are showing interstitial ad even in failed condition i.e., in OnAdLoadFailed().  May be that is the reason you are getting white page.

Then the next obvious question is why ad load is failing.  Well, it can be because your site id is not fetching interstitial ads.  Test with the id given in sample apps 6eb8367d91c74369acca148f3441fe52.  If it works with test id, then may be the issue is with your site id.  You can inform to inmobi about it.

 

Thanks.

king

Sorry my mistake.  You are calling AdLoad in failure case.  But try to use test id in your code and check if you are getting the ads.  Then you can confirm if the issue is with the site id.

Asad Shoaib

Math Knowledge Test (content id: 000000084742)

Unfortunately i don't own a tizen device, therefore i still don't know if ads are properly working, M.r King kindly download my app from tizen store and let me know if ads are working properly, i would be really grateful to you, thanks.

 

Peter Wegner

king...

Please confirm your success with Z3...

Only to be sure.

You mean SM-Z300H?

Can you tell us your Firmware Version + Tizen Version?

Only to be sure you are not Tester with Tizen version 2.4.0.4 or higher on SM-Z300H...

 

Thanx in advance.

 

Best Regards

king

Yes i am using Z300H device with Tizen firmware 2.4.0.3 Z300HDDU0BPE1.

I also confirm that the settings app doesnt have Ads option in it.

Please refer to https://samsung.tizenforum.com/application-development/monetize-your-tizen-apps-with-inmobi-tizen-ads-sdk/msg90139/#msg90139.

FAQ 4, 5, 6 makes it clear that AdId is required for personalization of ads and if AdId is not there  (such as in devices Z1 and Z3), default ad id of zeroes will be used.

Only constraint is that the device should be of 2.4 version.

Attached snapshot also:

 

Asad Shoaib

Math Knowledge Test (content id: 000000084742)

Unfortunately i don't own a tizen device, therefore i still don't know if ads are properly working, can any of you good folk help me by downloading my app from tizen store and let me know if ads are working properly, i would be really grateful to you guys, thanks.

king

Hi Asad

I have downloaded your application on Z2 and i am not getting any ads in the application.

As i have already suggested to you, i used your siteid "2cabe3d102f112345a93f608a082c0c3" in the NativeSampleApplication given @ developer.tizen.org site and i always get banner_ad_failed event.

But with test site id "6eb8367d91c74369acca148f3441fe52" i am getting the ads in the Sample.  So i would suggest you to report this to inmobi and confirm if your site id is allowed to fetch the ads.

 

regards

King.

Asad Shoaib

Actually i did changed my app id slightly by including in it few random numbers, because i thought i shouldn't publish the actual id publically. Because InMobi support is too unresponsive therefore i guess i have no other option.

Below is the actual script i'm using in my app with real app id provided by inmobi, as you can see i'm only showing interstetial ads because i'm not really interested in banner ads, i did contacted inmobi support they said i have hundreads of valid ad requests but not a single ad served, unfortunately i still don't able to solve this issue, these are the app details, Math Knowledge Test (Content ID: 000000084742), your help is really appreciated.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Tizen.AdLib;
using System;
using UnityEngine.UI;
public class AdListener1:BannerAdListener
{
private AdProvider adobj;
public AdListener1(AdProvider adobject)
{
adobj = adobject;
}
public void OnAdClicked (IntPtr handle)
{
}
public void OnAdLoadFailed (IntPtr handle, ErrorType error)
{
}
public void OnAdLoadSucceeded (IntPtr handle)
{
//adobj.BannerAdSetVisibility (handle, true);
}
}
public class AdListener:InterstitialAdListener
{
public void OnAdClosed (IntPtr handle)
{
AdProvider.Instance.InterstitialAdLoad ();
}
public void OnAdLoadFailed (IntPtr handle, ErrorType error)
{
AdProvider.Instance.InterstitialAdLoad ();
}
public void OnAdLoadSucceeded (IntPtr handle)
{
Debug.Log ("Entered to OnAdLoadSucceeded");
AdController.isInterstetialLoaded = true;
//AdProvider.Instance.InterstitialAdShow ();
}
public void OnAdOpened (IntPtr handle)
{
}
}
public class AdController : MonoBehaviour {
public static bool isInterstetialLoaded;
AdProvider adobject = AdProvider.Instance;
void Awake()
{
DontDestroyOnLoad(this);
if (FindObjectsOfType(GetType()).Length > 1)
{
Destroy(gameObject);
}
}
void Start () {
isInterstetialLoaded = false;
IntPtr handle, handle2;
adobject.InitAdlib ("2cabe3d102f147f1ba93f608a082c0c3","_inmobi", "https://i.l.inmobicdn.net/sdk/jsac/p1/inmobi.js", "inmobi_conf");
Debug.Log ("Entered in to start");
AdListener1 adListener_b = new AdListener1(adobject);
AdListener adListener_i = new AdListener();
adobject.AddInterstitialAd ();
adobject.InterstitialAdLoad ();
adobject.SetInterstitialAdListener (adListener_i);
ErrorType result = adobject.AddBannerAd (BannerAdSize.BANNER_AD_SIZE_BIG, out handle);
Debug.Log ("Handle value:"+handle);
adobject.BannerAdLoad (handle);
result = adobject.AddBannerAd (BannerAdSize.BANNER_AD_SIZE_SMALL, out handle2);
Debug.Log ("Handle value:"+handle2);
adobject.BannerAdLoad (handle2);
adobject.BannerAdSetPosition (handle2, BannerAdPosition.BANNER_AD_POS_TOP_CENTER);
adobject.SetBannerAdListener (handle,adListener_b);
adobject.SetBannerAdListener (handle2, adListener_b);
}///
public void ShowAdClick()
{
if (isInterstetialLoaded == true) {
isInterstetialLoaded = false;
AdProvider.Instance.InterstitialAdShow ();
}
}
public void Quit()
{
adobject.DeinitAdlib();
Application.Quit();
}
}

Mark as answer
king

Hi Ashad,

I have tried using the site id provided by you above in my sample application.  But always i am getting AdFailed callback.  So definitely your id is not fetching the ads, you need to talk to inmobi about it. When inmobi confirms that there are hundreds of valid adrequests and no single ad is served, they should check why the ad is not served for this site id right. Better you contact the email given in documentation tizen.onboarding@inmobi.com.

regards

Asad Shoaib

Yes i did sent them email, Its been quite a time but they are too unresponsive.

king

Hi Ashad,

I can see the interstitial ads in your app (Math Knowledge Test), on Z2.

 

Asad Shoaib

Great, thanks for checking it. :)

Peter Wegner

Math Knowledge Test...

 

I am not able yet to find it on SM-Z130H...

Is this only for Z2, Z3 ?

Or I am blind...

---------

Few hours ago I have tried India RTL Server... still no device work...

I hope after CES somebody is able to fix this...

 

Best Regards

Asad Shoaib

I did disabled support for z1 because for unknow reasons app created by Unity3d was crashing on Z1 devices.

Peter Wegner

Thanx for sharing info, about your App.

 

Meanwhile I've found...

But I can not test...

After "Made with Unity Intro"... I see grey... Full Screen nothing... and after few Seconds it crashes complete.

Tested with my SM-Z130H CPD5 Tizen Version 2.4.0.3...

 

This could be the reason why not in Z1 Store...

 

Best Regards

king

Hi Peter, 

I think the unity apps built using 5.5.0 are not running on Z1.  Even i had the same issue.  Where as for Z2 and Z3 it works fine. May be unity can help us in finding out the issue.

Best regards

Peter Wegner

Thank you very much for feedback.

 

Best Regards

Asad Shoaib

yes I did disabled support for z1 because for unknow reasons, app created by Unity3d was crashing on Z1 devices.

Peter Wegner

No idea, interesting comment...

https://samsung.tizenforum.com/application-development/tizen-inmobi-ads-0-earning/

 

I have no idea if this is true...

I have also no idea how long New Year Holidays...

Because more "offline"... not only RTL Server India...

 

Tizen support is very very low, now at lowest point in my opinion...

 

Best Regards