Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.

Offerwall

Dominic Roberts edited this page Dec 4, 2017 · 7 revisions

Offerwall

Contents

The Offerwall is a full-screen visual that appears inside your application. IronSource is the only network that supports this ad unit.

1. Register a placement tag

We require to set a placement tag for The Offerwall before loading. It is requiring only for iOS platform at the moment. To begin preparations for displaying The Offerwall, go back to your initialisation code where you had setup the Tapdaq SDK, and add modify it to look like this:

// create a config
var config:TapdaqConfig = new TapdaqConfig(APPLICATION_ID, CLIENT_KEY);

// Setup the placements with ad types your app will use
var placements:Array = [
	placements.push(new Placement([TapdaqCreativeType.OFFERWALL]));
];

// register placements in config
config.withPlacementTagSupport(placements);

// init Tapdaq ANE
_tapdaq = Tapdaq.init(config);

2. Register a listener

We need to register an Offerwall listener to get events when you work with Offerwall.

Offerwall.getInstance().addEventListener(TapdaqEvent.DID_LOAD,onTapdaqEvent);
Offerwall.getInstance().addEventListener(TapdaqEvent.DID_SHOW,onTapdaqEvent);
Offerwall.getInstance().addEventListener(TapdaqEvent.DID_CLOSE,onTapdaqEvent);
Offerwall.getInstance().addEventListener(TapdaqEvent.DID_CUSTOM,onTapdaqEvent);

3. Load The Offerwall

First we have to load the Offerwall:

Offerwall.getInstance().load();

We should receive the TapdaqEvent.DID_LOAD event when it is loaded or check Offerwall availability.

4. Check The Offerwall Availability

After we loaded Offerwall we could check if it is available.

Offerwall.getInstance().isAvailable();

5. Show The Offerwall

Now we could show Offerwall to user:

Offerwall.getInstance().show();

6. Rewards

Offerwalls may provide users with rewards, in this case you will receive 'TapdaqEvent.DID_CUSTOM' event and reward related information as a data will be passed to the event.

private function onTapdaqEvent(event:TapdaqEvent) : void {
	switch (event.type){
		case TapdaqEvent.DID_CUSTOM:
			var rewardInfromation : Dictionary = event.data;
			break;
		}

		logInConsole("You received a reward!");
	}
}

Need help?

If you are having any problems integrating, feel free to contact us on support@tapdaq.com and we will be more than happy to help.

What's next?

Now that you have successfully integrated a native ad into your app, what would you like to do next?

Clone this wiki locally