Ad plugins

What are the free ad plugins for Android and which makes the most money?

For my games Admob and Unity Ads are the most effective ones.

You can use their own plugins or enable them through mediation platforms like Appodeal.

Thanks you :wink:

I would like to use admob and tried the demo file available here to understand how it works :
https://github.com/coronalabs/plugins-sample-admob
It crashes on my Android phone (v14) with the latest Solar2D version.

How to make local tests before publishing? When I go to admob site, I need to select a published app to get an ID…

I read that’s possible to test my device with an AdID or IDFA. Is it this ID I can use in admob.init( adListener, { appId= "YOUR_ADMOB_APP_ID" } ) ?

Already 10 minutes I am shaking my phone to see an Ad but nothing appears :thinking:

You should be able to add an app before it is published. Go to “Add App” and next to the question “Is your app listed on a supported app store?”, just tick “No”. You can complete the setup process, get your app ID and placement IDs and start testing. You will just need to go back after the app is live to get it reviewed and finalized.

Also, AdMob ignores the appId flag in init now. Your app ID goes in applicationChildElements in build.settings:

<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="YOUR_ADMOB_APP_ID"/>  -- See: https://goo.gl/fQ2neu

Thank you for all your clear explanations!
I was not in the right section of the Admob site. I was in the parameters/device test.
Glad that I’m going to try this plugin in hoping that is works fine :slight_smile:

Try loading the ad after a 10-second delay. My guess is that if you were watching the feed in logcat, you’d see your initial load throw an error along the lines of AdMob not being ready to load ads yet.

Also, in if ( admob.isLoaded( "interstitial" ) ) then in the touch function, add

else
admob.load( "interstitial", { adUnitId="ca-app-pub-1871249691261196/1173341240" } )

All is ok on admob site, I completed my payment account but nothing is displayed. This plugin seems not working.
Is there any sample projects that I can test?

If the alpha isn’t changing, then it looks like the init phase isn’t happening. Are you watching on logcat? What kind of messages are you seeing? Backing up- are you trying this on device or on the simulator?

I don’t use it on simulator but on my Android phone (Galaxy A13, v14), so nothing is displayed except the rectangle which should change after the init. I don’t have any logcat.

Should I try Unity Ads? Maybe it will work?

Well, with UnityAds, same problem, only the rectangle will be displayed, no ad, that’s strange…

build.settings

settings =
{
	orientation =
	{
		default = "portrait",
		supported = { "portrait", },
	},

	android =
    {
 		minSdkVersion = "19",
    },
		
	plugins =
    {
        ["plugin.unityads.v4"] =
        {
            publisherId = "com.solar2d"
        },
    },
}

main.lua

local unityads=require("plugin.unityads.v4")
 
local function adListener(evt)
    if evt.phase=="init" then
		unityads.load("Interstitial_Android")
    end
end

unityads.init(adListener,{gameId="5814568"}) 
 
timer.performWithDelay(10000,function()	
		display.newRect(0,0,400,400)
		unityads.show("Interstitial_Android")
	end
)

You can download the Android Platform Tools here:

(No idea why it’s showing up in Korean.)

Thanks, I didn’t know. So with that I can test my code for the ads directly on Windows without Solar2d?

EDIT; I just got an email from Google: my account is approved only now! It could explain all ^^
I have to do the tests with Admob again to check.

It works now :slight_smile: It was long, 4 days to approve the account, without it, even simple tests don’t work. It’s maybe the same case with Unity Ads, I will wait some days and check again. Thanks for all your tips!

1 Like

Not that, but adb install is a quick way to load .apk files onto your device, and adb logcat gives you an output similar to the simulator console.

You’ll need to put your Android device into Developer Mode:

You can read all the instructions for adb on it’s page, but the two main ones to know are:
adb install -r [path for file]
and
adb logcat Corona:D *:S

1 Like

Great! Why I didn’t know that before, that’s so useful to display infos! Thanks!