-
Notifications
You must be signed in to change notification settings - Fork 0
Offerwall
- 1. Register a placement tag
- 2. Register a listener
- 3. Load The Offerwall
- 4. Check The Offerwall Availability
- 5. Show The Offerwall
- 6. Rewards
The Offerwall is a full-screen visual that appears inside your application. IronSource is the only network that supports this ad unit.
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);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);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.
After we loaded Offerwall we could check if it is available.
Offerwall.getInstance().isAvailable();Now we could show Offerwall to user:
Offerwall.getInstance().show();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!");
}
}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.
Now that you have successfully integrated a native ad into your app, what would you like to do next?