Skip to content

Instantly share code, notes, and snippets.

@nickreffitt
Last active September 23, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickreffitt/1d0badf2e1c6b9f7afc5c5da22e2f274 to your computer and use it in GitHub Desktop.
Save nickreffitt/1d0badf2e1c6b9f7afc5c5da22e2f274 to your computer and use it in GitHub Desktop.

Setting the config is now slightly different.

2.5.4 and before:

//Create List of creative types to display
CreativeType[] types = {CreativeType.INTERSTITIAL_PORTRAIT};

//Initialise Tapdaq SDK
Tapdaq.tapdaq().initializeWithConfiguration()
        .withTestAdvertsEnabled(false) //Optional
        .withCreativeTypesSupport(types) //Optional
        .withFrequencyCapping(0,0) //Optional
        .withMaxNumberOfCachedAdverts(2) //Optional
        .initialize("<AppID>", "<ClientKey>", this, new TapdaqCallbacks(this)); //Callbacks is optional

2.5.5:

//Create List of creative types to display
CreativeType[] types = {CreativeType.INTERSTITIAL_PORTRAIT};

//Tapdaq Config (Optional)
TapdaqConfig config = new TapdaqConfig(this);
config.withTestAdvertsEnabled(false);
config.withCreativeTypesSupport(types);
config.withFrequencyCapping(0,0);
config.withMaxNumberOfCachedAdverts(2);

//Initialise Tapdaq SDK
Tapdaq.tapdaq().initialize(this, "<APP_ID>", "<CLIENT_KEY>", new TapdaqCallbacks(), config); //Callbacks && Config are optional and may be set to null

Note: Setting creative types and creating a customised TapdaqConfig instance is entirely optional, by default the SDK will use Interstitial Portrait & Landscape ads, so a dev may initialise with just this if they’re not using Native Ads:

//Initialise Tapdaq SDK
Tapdaq.tapdaq().initialize(this, "<APP_ID>", "<CLIENT_KEY>"); 

Or this:

//Initialise Tapdaq SDK
Tapdaq.tapdaq().initialize(this, "<APP_ID>", "<CLIENT_KEY>", new TapdaqCallbacks());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment