Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No ads visible? #2

Open
turdparty opened this issue Nov 6, 2016 · 0 comments
Open

No ads visible? #2

turdparty opened this issue Nov 6, 2016 · 0 comments

Comments

@turdparty
Copy link

Hi, I have tried both amazonads and admob but I get nothing.
I have the feeling I'm overlooking something very simple.
Can you tell me what is wrong with this test project please?
(Obviously the banner/interstitial id's should be replaced with the id's from the amazon/admob accounts)
Did I forget to enter the App Id somewhere? Or is it not necessary?

adtest.zip

Basic Main code:
`package;

import extension.multiads.Ads;
import flash.text.TextField;
import openfl.Lib;
import openfl.display.Sprite;
import openfl.events.Event;
import openfl.events.MouseEvent;

class Main extends Sprite {

public function new () {
	super ();
	Ads.enableTestingAds();
	//no app id needed?
	//Ads.initAmazonAds( "32 character id", Ads.VALIGN_BOTTOM);
	Ads.initAndroidAdMob( "banner id","interstitial id", Ads.VALIGN_BOTTOM);
	
	if (stage!=null) init(null);
	else addEventListener(Event.ADDED_TO_STAGE, init);
}

private function init(e:Event):Void
{
	stage.addEventListener(MouseEvent.CLICK, OnClick);
}

private function OnClick(e:MouseEvent):Void
{
	Ads.showBanner();
}

}`

Basic project.xml:
<?xml version="1.0" encoding="utf-8"?> <project> <!--<set name="amazon"/>--> <set name="admob"/> <meta title="Adtest" package="com.sample.adtest" version="1.0.0" company="Company Name" /> <app main="Main" path="Export" file="Adtest" /> <source path="Source" /> <haxelib name="openfl" /> <haxelib name="extension-multiads" /> <!--<haxelib name="extension-amazonads" />--> <assets path="Assets" rename="assets" /> </project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant