bio1712
Citizen
Posts: 50
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Here I made a modified version of LÖVE 0.10.2, with a new module:

With this module is possible to request and display ads from LÖVE!
An AdMob account is needed in order to use this module.

I have added 9 functions and 5 callbacks:

string position : The position of the banner. Can be "top" or "bottom".
Initializes the banner ad without displaying it. This function may be fired only once.
The banner inizialized is a smart banner.
Displays the banner ad. This function may be fired after createBanner
Hides the banner ad. This function may be fired after createBanner
Requests an interstitial ad. This function should be called every time a new ad is needed.
Check if the interstitial ad previously requested is ready to be shown.

Returns:
Requests a rewarded video ad. This function should be called every time a new ad is needed.
Check if the rewarded video ad previously requested is ready to be shown.

Returns:
• love.interstitialClosed()
Fired when the user closes an interstitial ad.
• love.rewardUserWithReward(string rewardType,number rewardQuantity)
string rewardType : The type of the reward you set in your AdMob dashboard.
number rewardQuantity : The quantity of rewards you set in you AdMob dashboard.

Fired when a rewarded video ad successfully finishes playing.
Fired when a rewarded video ad is closed by the user.
This callback is fired even if the video has already finished.

In order to use it, you need to set up the project like with the normal LÖVE iOS source.

Included in the source, there is an example game.love.
IMG_2672.PNG (81.15 KiB) Viewed 3364 times
Note: all the Ad-Unit IDs in the game.love are from this url.
Last edited by bio1712 on Mon Aug 07, 2017 4:15 pm, edited 1 time in total.

yetneverdone
Party member
Posts: 302
Joined: Sat Sep 24, 2016 11:20 am
Contact:

### Re: AdMob support for iOS!

Cool! That's what i was waiting for. Thanks.

Anyways, i have question:
1. What do you need to build a project with that added functions?

bio1712
Citizen
Posts: 50
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

### Re: AdMob support for iOS!

yetneverdone wrote:
Mon Jul 24, 2017 9:50 am
Cool! That's what i was waiting for. Thanks.

Anyways, i have question:
1. What do you need to build a project with that added functions?
To build this project you need only the source, and you build it like you built the official love project.

Rucikir
Party member
Posts: 123
Joined: Tue Nov 05, 2013 6:33 pm
Location: Paris
Contact:

### Re: AdMob support for iOS!

You could fork LÖVE git repository and branch from 0.10.2, and apply your changes here. It will be easier to maintain and to use.
Lua script to distribute your LÖVE games. love-release.lua : Forum | Github
@Rucikir

yetneverdone
Party member
Posts: 302
Joined: Sat Sep 24, 2016 11:20 am
Contact:

### Re: AdMob support for iOS!

I agree with ruckir

Marty
Citizen
Posts: 89
Joined: Mon Dec 04, 2017 1:47 am
Location: Germany

### Re: AdMob support for iOS!

First of all, thank you for your great work.

Please make it easier to find the place where I have to put the App ID. On Android there is a string "YOUR-APP-ID-HERE" that is easy to spot in the AdActivity. However, this thing is missing in the Ads.mm and I was not able to spot it anywhere so far.

Where is it located?

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█

Marty
Citizen
Posts: 89
Joined: Mon Dec 04, 2017 1:47 am
Location: Germany

### Re: AdMob support for iOS!

For everybody having the same issue, here is what worked for me.

Code: Select all

Ads::Ads()
{
}

with my proper App-ID of course.

Also if you want to test it with real ads, make sure you configure your payment methods on the admob platform.

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█

bio1712
Citizen
Posts: 50
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

### Re: AdMob support for iOS!

modiX wrote:
Sun Jan 07, 2018 9:46 pm
First of all, thank you for your great work.

Please make it easier to find the place where I have to put the App ID. On Android there is a string "YOUR-APP-ID-HERE" that is easy to spot in the AdActivity. However, this thing is missing in the Ads.mm and I was not able to spot it anywhere so far.

Where is it located?
Hi, I'm sorry I haven't seen this post before. Please forgive me.

As you have noticed, I've replied here.

deulamco
Prole
Posts: 1
Joined: Fri Apr 27, 2018 6:58 am

### Re: AdMob support for iOS!

Hello there, would you mind making a pull request to the official LOVE2D hub ?
So the Ads ( and future IAP module ) could come along with new version

### Who is online

Users browsing this forum: No registered users and 4 guests