Help with ADS and FACEBOOK support

Hey, new to the forum! I recently finished my game (for android) but i cant (really, i cant understands how it works) add these two things:
-An ad banner that pop up whenever the player dies
-A facebook box that when clicked it let the player share his score on facebook
For the ad i just cant understand what i have to do as i tried to follow the admob extension example but with no results. While for facebook i understood the code part but i cant figure out how to place the extension into the game (as it asks both android studio and maven). If someone could direct me to the right way it would be great! Thanks for the help!

1 Like

You do not need an extension for Facebook. Defold is shipped with the Facebook SDK and Lua bindings. Check the facebook.* namespace of our API docs.

As for ads I’d totally recommend that you use the FGL extension from our asset portal. Super easy to integrate AdMob and many other SDKs.

3 Likes

oh, great! Thank you, now i finally understand how it works!

1 Like

Have you looked at my recent admob extension? https://www.defold.com/community/projects/93085/

It’s quite easy to add a banner.
Init on game start.

admob.init{
	app_id = 'your_admob_app_id',
	test = true, -- ALWAYS use test ads, only disable when submitting to the stores.
	listener = listener
}

Show a banner when you want later on.

admob.load{
	type = 'banner',
	id = 'your_banner_id_from_admob_here',
	size = 'smart',
	position = 'bottom',
	keywords = {'puzzle', 'game'}
}
2 Likes