- Home /
Inserting mobile ads into Unity games
Hi!
I'm new to mobile and Unity development, and I want to start a project of making mobile games for iOS and Andriod. I'm trying to figure out wich option would suit best my needs, and Unity is clearly a great one with the power and simplicity that it offers.
The thing is that I want to make money from this games by using ads.
I want to know if the implementation of these ads is posible in Unity, before choosing it to develop.
Some of those ads companies are these:
http://mmedia.com/resources/sdk-api/
http://www.airpush.com/android-developers/
http://www.starapplication.com/
I would appreciate if someone could confirm or deny this. I hope that this can be made, because I really want to develop in Unity.
Thank you in advance, and sorry for my bad english!
The thing is that I want to make money from this games by using ads.*
First, you might want to try making money from the game by making it so good that everyone wants to play it, and promoting it so effectively that everyone knows about it.
If you can do that already, certainly you can then make more money from ads. But if not... your ads will probably make the difference between grossing $100 on the game and grossing $115 on the game. 99% of mobile games will earn you less for 6 months of work than you'd make in tips one night waiting tables. So if you're really in it for the money, you should probably GTFO now.
Thank you for your thoughts, but i'm not here to discuss the nature of my desitions. I just need a technical answer on the matter, not a childish opinion.
As far of making games, I can think of at least 500 reasons why I would need money to make better games. $$anonymous$$aybe you could think a couple of them while you serve the customers...
Ads are very possible, and possible within a few different ways.
For starters I know they are doable on Android, simply because I currently have ads. I use Admob to do this, haven't tried any other ad network yet though.
So if you go into the asset store there are actually plugins that will do it for you, you pretty much don't have to do anything. They do cost (or at least last time I checked they cost).
I created my own plugin, this is for Android. I created a java class in eclipse that created the ad. This class also centered it and has methods to delete it.
From Unity I call
public static AndroidJavaClass AdClass;
AdClass = new AndroidJavaClass("com.package.name.for.ads");
AdClass.CallStatic("methodInsideThatClass");
you have to also edit your android manifest.
As for IOS I know you can add ads from inside XCode. Don't know how, I've never done IOS, but it's possible. A simple google search will $$anonymous$$ch you.
Perhaps you should Google before you ask.
Thank you so much! that was the answer I was looking for!
Answer by hikmat · Feb 24, 2014 at 07:53 AM
Hi Unity also provide wrapper for AdBannerView Objective C. You can easily use Unity's AbBannerView to implement iad in your ios app.See code below. Attach this script to empty game object in screen and you are ready to go and earn.
using UnityEngine; using System.Collections; using System.Runtime.InteropServices;
public class ads : MonoBehaviour {
private ADBannerView banner = null;
// Use this for initialization
void Start () {
banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Top);
ADBannerView.onBannerWasClicked += OnBannerClicked;
ADBannerView.onBannerWasLoaded += OnBannerLoaded;
}
// Update is called once per frame
void Update () {
hideBannerIfNotLoaded();
}
void OnBannerClicked()
{
Debug.Log("Clicked!\n");
banner.visible = false;
banner = null;
banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Top);
ADBannerView.onBannerWasClicked += OnBannerClicked;
ADBannerView.onBannerWasLoaded += OnBannerLoaded;
}
void OnBannerLoaded()
{
Debug.Log("Loaded!\n");
banner.visible = true;
}
void hideBannerIfNotLoaded(){
if(banner.visible && !banner.loaded)
{
banner.visible = false;
}
}
}
Answer by nissan7 · Oct 18, 2013 at 04:32 PM
i tried the starapplication's solution they offer a great revenue its about $105 eCPM, in the begining they offered 6 monetisation tools but now there are only three because of the google policy, i advice u to try it! they are realy correct in paiement and they are doin a really good job :) good luck