• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by hellobard · May 14, 2013 at 09:12 PM · admobiad

iAd fallback to AdMob

Hi,

I am trying to get my iAd code (which is working perfectly), to fall back to AdMob (using Prime31's plugin) when there are no ads being served from Apple.

Here's the code I am using:

 #pragma strict
 
 import System.Collections.Generic;
 
 // Bard iAd
 
  var banner:ADBannerView;

 function Start () {

 // Bard iAd + AdMob + Chartboost
 
     StartCoroutine(ShowBanner());
     ChartBoostBinding.showInterstitial( "default" );
     AdMobBinding.init( "a1518d4a265caae", true );

 }

 
 function Update () {
 }
 

 function Awake () {
     ChartBoostBinding.cacheInterstitial( "default" );
 
 }
 
  
 
 function ShowAdsChartboost () {
 
     ChartBoostBinding.showInterstitial( "default" );
 
 }
 

 // Bard iAd
 
 function ShowBanner() {
 

     banner = new ADBannerView();
 
     banner.autoSize = true;
 
     banner.autoPosition = ADPosition.Bottom;
 
     Debug.Log(banner.error);
 
     while (!banner.loaded && banner.error == null)
 
         yield;

     if (banner.error == null)
 
         banner.Show();
     
     else banner = null;
 
 }



I tried changing a part of my ShowBanner function to:

if(banner.error == false) {

     banner.Show();

 } else if(banner.error == true) {

     AdMobBinding.createBanner( AdMobBannerType.iPhone_320x50, AdMobAdPosition.BottomRight );

 }


But that didn't work on the device... Has anyone done this? Would love to get some tips on this.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Pigghaj · Jul 31, 2013 at 02:55 AM 0
Share

You managed to get this working?

avatar image Pigghaj · Jul 31, 2013 at 01:03 PM 0
Share

Okay, thanks for answering. I am trying to decide between different options and also felt iAd with Ad$$anonymous$$ob fallback seems like the best solution. Good to hear you got it working.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by hellobard · Jul 31, 2013 at 12:20 PM

yeah, but not with this script. I just bought the AdMob plugin from Prime31 for unity. works great and it will serve iAds, Google Ads, etc. with a control over which is served first from the AdMob website.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by psycocrusher · Oct 01, 2014 at 05:26 PM

You can do that directly from admob's portal. You click edit mediation, and you give a higher value to iads.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is there a way to tell if show iAd failed (with prime31 iOS Plugin) 0 Answers

Can I modify codes using Xcode after creating the app using Unity3d? 1 Answer

IAds Banner help. If IAds isn't showing show admob. 1 Answer

Tapping iAd via AdMob is triggering RANDOM clicks on sprites in my scene. 1 Answer

iAd in Unity 1.7 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges