This guide describes steps required when updating from one Tapdaq SDK version to another, its recommended you perform all the steps to prevent any issues or conflicts.
In your Build.gradle file, update the version of the Tapdaq SDK and any adapters, see [Quickstart|Quickstart] for full details. Then sync your project.
dependencies {
implementation 'com.tapdaq.sdk:Tapdaq-BaseSDK:[VERSION]'
}
The following guide explains how to upgrade Tapdaq's Android SDK between each version.
Download our Base-SDK, adapters & networks sdk's from Manual Integration page.
Retrieve latest Tapdaq-BaseSDK.jar from the latest sdk package and simply replace the previous version in your libs folder. See further details on our Manual Integration page.
Within each network download on the Manual Integration page, the zip contains both adapter and network sdk files either in jar or .aar, include them in your project. If you are unable to include a .aar - these can be renamed to a zip, uncompress it and find the classes.jar within instead, note that if there are res or asset folders, these must also be included in your project.
This section notes any changes that need to be made when upgrading to specific version.
Added support for the following networks:
USPrivacyStatus has been changed to USPrivacyStatusDoNotSell for clarity.
TapdaqConfig config = Tapdaq.getInstance().config();
//Deprecated
config.setUSPrivacyStatus(STATUS.TRUE);
//Added
config.setUSPrivacyDoNotSellStatus(STATUS.TRUE);
//Deprecated
Tapdaq.getInstance().setUSPrivacyStatus(MainActivity.this, STATUS.TRUE);
//Added
Tapdaq.getInstance().setUSPrivacyDoNotSellStatus(MainActivity.this, STATUS.TRUE);
UserSubjectToUSPrivacy states whether a user is in a US state that has privacy laws to inhibit the sale of user data. US Privacy status states whether to enforce privacy, for many networks setting this to TRUE will forward a "true" flag for doNotSell CCPA flags.
As of this version AdMob, IronSource & Mintegral receive these flags.
For use before initialising:
Tapdaq.getInstance().config().setUserSubjectToUSPrivacyStatus(STATUS);
Tapdaq.getInstance().config().getUserSubjectToUSPrivacyStatus();
Tapdaq.getInstance().config().setUSPrivacyStatus(STATUS);
Tapdaq.getInstance().config().getUSPrivacyStatus();
For use after initialising
Tapdaq.getInstance().getUserSubjectToUSPrivacyStatus();
Tapdaq.getInstance().setUserSubjectToUSPrivacyStatus(Context, STATUS);
Tapdaq.getInstance().getUSPrivacyStatus();
Tapdaq.getInstance().setUSPrivacyStatus(Context, STATUS);
GDPR interfaces have been updated to all use the STATUS values for setters/getters to make it clearer and updating the values more flexible.
Tapdaq.getInstance().getUserSubjectToGdprStatus();
Tapdaq.getInstance().setContentGiven(Context, STATUS);
Tapdaq.getInstance().getConsentStatus();
Tapdaq.getInstance().setIsAgeRestrictedUser(Context, STATUS);
Tapdaq.getInstance().getAgeRestrictedUserStatus();
Tapdaq.getInstance().config().setUserSubjectToGdprStatus(STATUS);
Tapdaq.getInstance().config().setUserSubjectToGdprStatus(STATUS);
Tapdaq.getInstance().config().setConsentStatus(STATUS);
Tapdaq.getInstance().config().getConsentStatus();
Tapdaq.getInstance().config().setAgeRestrictedUserStatus(STATUS);
Tapdaq.getInstance().config().getAgeRestrictedUserStatus();
Tapdaq.getInstance().isUserSubjectToGDPR();
Tapdaq.getInstance().isUserSubjectToGDPR(Context);
Tapdaq.getInstance().setContentGiven(Context, boolean);
Tapdaq.getInstance().isConsentGiven(Context);
Tapdaq.getInstance().setIsAgeRestrictedUser(Context, boolean);
Tapdaq.getInstance().isAgeRestrictedUser(Context);
Tapdaq.getInstance().config().setUserSubjectToGDPR(STATUS);
Tapdaq.getInstance().config().isUserSubjectToGDPR();
Tapdaq.getInstance().config().setConsentGiven(boolean);
Tapdaq.getInstance().config().getConsenStatus(boolean);
Tapdaq.getInstance().config().setIsAgeRestrictedUser(boolean);
For networks which support an SDK level mute flag for ads, this flag will be used for them.
Tapdaq.getInstance().config().setMuted(boolean);
Tapdaq.getInstance().config().getMuted();
As of this version AdMob, AppLovin, Mintegral & Vungle use this flag
A number of changes to banners have been implemented in this version.
It's now possible to pass in placement tags as a load parameter, this will only load networks which have the placement tag enabled.
public class TMBannerAdView {
public void load(Activity activity, TMAdSize size, TMAdListenerBase listener); // Load with default placement & specified banner type
public void load(Activity activity, String placement, TMAdSize size, TMAdListenerBase listener); // Load with specified placement and specified banner type
public void load(Activity activity, String placement, TMAdListenerBase listener); // Load with specified placement using custom size of view
}
A new banner type is now available called CUSTOM, this allows the TMBannerAdView to be any size, when calling the load method without a TMSize parameter, the size of the view will be used and the banner type will be selected on a best fit basis. E.g. if the view is 400x60 a Standard or Smart banner will be used depending on which network is used.
TMAdListenerBase now has a didFailToRefresh method, this will be called if the banner cannot load a new ad after it has succeeded the first time, didRefresh will be called if it was successful. An error will be provided with details of the failure like didFailToLoad callback does.
public interface TMAdListenerBase {
void didFailToRefresh(TMAdError error);
}
The following classes/methods will be removed in future versions.
This class is no longer used, the callback methods do not get fired - use TMAdListenerBase instead.
@Deprecated
public interface TMVideoAdListenerBase extends TMAdListenerBase {
@Deprecated
void didComplete();
@Deprecated
void didEngagement();
}
Tapdaq-BaseSDK & Adapters now depends on AndroidX rather than Android support libraries, note that many network sdk's still use android support libraries, so you MUST use jetifier to make them compatible.
For all users, Tapdaq's GDPR settings must be set to something other than unknown before initialising for YouAppi to function. For users outside of the EU UserSubjectToGdpr should be set to false For users inside of the EU UserSubjectToGdpr should be set to true, also Consent should be provided for YouAppi to intialise. Note the consent MUST be obtained from the user.
If any other settings are provided, YouAppi will not be initialised and will not display ads.
See User Privacy page for details on how to set GDPR settings
Two new networks have been added to Android for Video & Rewarded Video content.
Tapdaq interface methods onResume/onPause methods are no longer required as support for Receptiv has been removed, they have been marked as deprecated and will be removed in future releases.
public class Tapdaq {
public void onResume(Context context)
public void onPause(Context context)
}
All Offerwall related methods have been removed, however the Tapjoy Offerwall may be used alongside Tapdaq as detailed on our Offerwall page
Tapdaq.getInstance().loadOfferwall(<Activity>, new TMAdListener());
Tapdaq.getInstance().isOfferwallReady(<Activity>)
Tapdaq.getInstance().showOfferwall(<Activity>, new TMAdListener());
public class TMAdListener {
public void didCustomEvent(Map<Object, Object> eventData)
}
A UserId field has been added to the TapdaqConfig & Tapdaq interface, this replaces the hashed_user_id that was passed into showRewardedVideo method, which is now deprecated. If UserId is not set, the hashed_user_id will continue to be used (if available).
Support-v4 is no longer required for Tapdaq BaseSDK, however it is still required for the following networks:
The Ironsource Adapter has changed its implementation to use Instance IDs rather than Placements, both are available on the Ironsource dashboard and should be replaced in the Tapdaq dashboard.
Replacing ID's will cause previous SDK's to fail to load ads, vice versa leaving placements in the dashboard will cause new SDK's to fail to load.
Offerwalls will now fail to load as the Ironsource Offerwall implementation has been removed. The load/Show interface remains but will be removed in later versions.
NEW: SDK version 7.0.0 supports zones. Please note, this release does not currently support cross promotion ad serving. To access our cross promotion features, please use SDK version 6.4.0
It's no longer required for placement tags to be registered with the TapdaqConfig object before initialising the SDK. Placement Tags are still used for Loading & Showing ads.
TapdaqConfig class remains, but the following methods have been REMOVED:
TapdaqConfig config = new TapdaqConfig();
config.registerPlacement();
config.getPlacementTags();
config.getRegisteredPlacements();
config.withCreativeTypesSupport();
config.withPlacementTagSupport();
didFailToDisplay will be called after calling showAd (Interstitial, Video, Rewarded Video, Offerwall) if there is no ad to show, or the ad is unable to display. An error will be provided.
public interface TMAdListenerBase {
void didFailToDisplay(TMAdError error);
}
AdMob content rating will be forwarded for every ad request to AdMob, to do this, set the value in the config either before Tapdaq has initialised or after like so:
//Before Tapdaq initialises
TapdaqConfig config = new TapdaqConfig();
config.setAdMobContentRating("MA"); // G, PG, T, MA
config.setIsAgeRestrictedUser(true); // GDPR/COPPA flag
//After Tapdaq initialises
Tapdaq.getInstance().config().setAdMobContentRating("MA"); // G, PG, T, MA
Tapdaq.getInstance().config().setIsAgeRestrictedUser(true); // GDPR/COPPA flag
The tag_for_under_age_of_consent flag will be sent to AdMob if the user is subject to GDPR and AgeRestrictedUser is set. The ChildDirectedTreatment COPPA flag will be sent if user is not known to be subject to GDPR and AgeRestrictedUser is set. Read more about AdMob Targeting here.
The Tapdaq SDK & Adapter's can now be included in your project using a maven dependency, these will also automatically pull the network SDK's, so you are no longer required to add those dependencies unless you want to force a specific version.
Chartboost, Receptiv & UnityAds do not support gradle dependencies, so these Jars must still be added to your project manually.
In you APP_LEVEL Build.gradle file add the following:
google()
jcenter()
//Tapdaq SDK & Adapters
maven { url "http://android-sdk.tapdaq.com" }
}
dependencies {
//Tapdaq
implementation 'com.tapdaq.sdk:Tapdaq-BaseSDK:6.4.0'
//Adapters - These will automatically pull ad network dependencies
implementation 'com.tapdaq.sdk:TapdaqAdColonyAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqAdMobAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqAppLovinAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqChartboostAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqFANAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqInmobiAdapter:6.4.0'
//Ironsource dependency requires explicit reference
implementation('com.tapdaq.sdk:TapdaqIronsourceAdapter:6.4.0') {
transitive false
}
implementation 'com.ironsource.sdk:mediationsdk:[email protected]'
implementation 'com.tapdaq.sdk:TapdaqKiipAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqMoPubAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqReceptivAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqTapjoyAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqUnityAdsAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqVungleAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqYouAppiAdapter:6.4.0'
implementation 'com.tapdaq.sdk:TapdaqZPlayAdapter:6.4.0'
}
Note the IronSource exception, to avoid an error pulling its dependencies, set it to transitive and add the IronSource SDK depdendency
In your APP_LEVEL Build.gradle file update dependencies:
dependencies {
implementation 'com.adcolony:sdk:3.3.5' //AdColony
implementation 'com.applovin:applovin-sdk:8.1.4' //AppLovin
implementation 'com.inmobi.monetization:inmobi-ads:7.2.1' //InMobi
implementation 'me.kiip.sdk:kiip:3.0.1' //Kiip
//MoPub
implementation('com.mopub:mopub-sdk:[email protected]') {
transitive = true
}
// For banners
implementation('com.mopub:mopub-sdk-banner:[email protected]') {
transitive = true
}
// For interstitials
implementation('com.mopub:mopub-sdk-interstitial:[email protected]') {
transitive = true
}
// For rewarded videos. This will automatically also include interstitials
implementation('com.mopub:mopub-sdk-rewardedvideo:[email protected]') {
transitive = true
}
//MoPub End
implementation 'com.tapjoy:tapjoy-android-sdk:[email protected]' //TapJoy
implementation 'com.github.vungle:vungle-android-sdk:6.3.17' //Vungle
implementation ('com.playableads:playableads:2.1.1') //ZPlay
}
In the Networks/[NetworkName] folder with our sdk new jars are available for:
Constructor no longer requires Context parameter
//New Constructor
TapdaqConfig config = new TapdaqConfig();
//Removed Constructor
TapdaqConfig config = new TapdaqConfig(context);
FAN Adapter has updated to support 4.99.1.
In your APP_LEVEL Build.gradle file update dependencies:
dependencies {
implementation 'com.facebook.android:audience-network-sdk:4.99.1'
}
FAN Adapter has updated to support 4.99.0.
In your APP_LEVEL Build.gradle file update dependencies:
dependencies {
implementation 'com.facebook.android:audience-network-sdk:4.99.0'
}
TDMediatedNativeAd getIcon() method has been deprecated, replaced with getApppIconView which returns a View containing the icon, this object may be different type from each network.
//Deprecated getIcon
TDMediatedNativeAd ad;
if (ad.getIcon() != null) {
TDMediatedNativeAdImage image = ad.getIcon();
if (image.getDrawable() != null) {
mIconimageView.setImageDrawable(image.getDrawable());
} else if (image.getUrl() != null) {
new TClient().executeImageGET(getContext(), image.getUrl(), 0, 0, new HttpClientBase.ResponseImageHandler() {
@Override
public void onSuccess(Bitmap response) {
mIconimageView.setImageBitmap(response);
}
@Override
public void onError(Exception e) {
}
});
}
}
//Added getAppIconView
TDMediatedNativeAd ad;
if (ad.getAppIconView() != null) {
mIconView.addView(ad.getAppIconView());
}
Added UserSubjectToGDPR property, if this is not set to true then consent data will no longer be sent to ad networks. Where ad networks also request this field, we pass the value on.
STATUS can be TRUE, FALSE or UNKNOWN. By default it is UNKNOWN
NOTE: UserSubjectToGDPR must be set to TRUE before declaring if a user has provided consent. Where false, consent does not need to be sent
When initialising:
TapdaqConfig config = new TapdaqConfig(MainActivity.this);
config.setUserSubjectToGDPR(STATUS.TRUE);
config.setConsentGiven(true);
config.setIsAgeRestrictedUser(false);
After initialising:
Tapdaq.getInstance().setUserSubjectToGDPR(MainActivity.this, STATUS.TRUE);
Tapdaq.getInstance().setContentGiven(MainActivity.this, true);
Tapdaq.getInstance().setIsAgeRestrictedUser(MainActivity.this, true);
TapJoy has recently supported maven, we now recommend using the gradle dependencies method and removing the .jar from your libs folder. If you must continue using the Jar, you should use 11.12.2 which can be obtained from their website with this release.
In your APP_LEVEL Build.gradle file update dependencies:
repositories {
maven {
name "Tapjoy's maven repo"
url "https://tapjoy.bintray.com/maven"
}
}
dependencies {
//AdColony
implementation 'com.adcolony:sdk:3.3.4'
//TapJoy
implementation 'com.tapjoy:tapjoy-android-sdk:[email protected]'
}
GDPR compliance has been added in this version, apps should acquire EU users consent for networks to provide personalised ads. Pass the consent to Tapdaq if consent is available at initialisation it should be added like so:
TapdaqConfig config = new TapdaqConfig(MainActivity.this);
config.setConsentGiven(true);
Tapdaq.getInstance().initialize(MainActivity.this, <APP_ID>, <CLIENT_KEY>, config, new TMInitListener());
If consent is acquired mid session inform Tapdaq like so:
Tapdaq.getInstance().setContentGiven(MainActivity.this, true);
NOTE: Chartboost will not update consent mid session and must be set at initialisation
Some networks also ask if users are known to be under 16, this can also be set at initialisation or mid session like so:
TapdaqConfig config = new TapdaqConfig(MainActivity.this);
config.setIsAgeRestrictedUser(true);
Tapdaq.getInstance().initialize(MainActivity.this, <APP_ID>, <CLIENT_KEY>, config, new TMInitListener());
Set mid session like so:
Tapdaq.getInstance().setIsAgeRestrictedUser(MainActivity.this, false);
In your APP_LEVEL Build.gradle file update dependencies:
dependencies {
//AdColony
implementation 'com.adcolony:sdk:3.3.3'
//AppLovin
implementation 'com.applovin:applovin-sdk:8.0.1'
//FAN
implementation 'com.facebook.android:audience-network-sdk:4.28.1'
//InMobi
implementation 'com.inmobi.monetization:inmobi-ads:7.1.0'
//IronSource
implementation 'com.ironsource.sdk:mediationsdk:[email protected]'
//Kiip
implementation 'me.kiip.sdk:kiip:3.0.0'
//Vungle
implementation 'com.github.vungle:vungle-android-sdk:6.2.5'
//YouAppi
implementation "com.youappi.sdk:youappi-sdk-android-moat:4.1.1"
}
In the Adapter_Libs folder with our sdk new jars are available for:
Sample apps and documentation now target Gradle 3.x, only noticable difference here is the dependencies keywords have changed:
dependencies {
//Deprecated compile method
compile 'com.google.android.gms:play-services-ads:15.0.0'
//New implementation method
implementation 'com.google.android.gms:play-services-ads:15.0.0'
}
Both can still be used in projects.
The library Tapdaq (and our network partners) require to get the advertising id has changed:
dependencies {
//Old dependency
implementation 'com.google.android.gms:play-services-basement:11.8.0'
//New dependency with play services 15.+
implementation 'com.google.android.gms:play-services-ads-identifier:15.0.0'
//Or the ads dependency will include it automatically (Required for AdMob anyway)
implementation 'com.google.android.gms:play-services-ads:15.0.0'
}
NOTE: When using play services older than v15, basment or ads should still be used
We now recommend that the AppLovin sdk is added to your project using gradle, rather than as a jar (although jar's will still work).
dependencies {
...
compile 'com.applovin:applovin-sdk:7.8.5'
}
If Tapdaq fails to initialise due to invalid credentials, configuration, internet availability or anything else, didFailToInitialise
will be called and Tapdaq will be have been initiated. An error message will provide details for not initialising.
public class TapdaqInitListener extends TMInitListener {
public TapdaqInitListener() {
}
public void didInitialise() {
super.didInitialise();
}
@Override
public void didFailToInitialise(TMAdError error) {
super.didFailToInitialise(error);
}
}
HyprMX and Vungle now provide SDK's via maven, we recommend reviewing our Quickstart page to with new Build.Gradle repositories and dependencies.
Vungle Proguard settings have also changed as we've updated to Vungle SDK 5.3.2, review our Advanced page for details.
We've added a unique id value to each reward which will match that used in the server side callbacks, whilst doing so, we have consolidated all reward params into TDReward class.
TDReward.getCustom_json()
returns Object which is dependent on the json structure entered via the dashboard, it will either be a Map or an ArrayList.
public class TMAdListener {
@Deprecated
@Override
public void didVerify(String location, String reward, int value, boolean reward_valid, Map<Object, Object> custom_data) {
}
//Added new method
public void didVerify(TDReward reward) {
String id = reward.getId();
String name = reward.getName();
int value = reward.getValue();
String tag = reward.getTag();
Object custom_json = reward.getCustom_json();
}
}
Receptiv requires Android lifecycle events to be passed back to their SDK. This may be used by Tapdaq, or by other adapters in the future. You can read more about lifecycle methods in our Quickstart Guide.
Tapdaq.getInstance().onPause & Tapdaq.getInstance().onResume must be called from all of your Activities** by overriding the onPause and onResume methods.
Here's an example:
@Override
protected void onPause() {
super.onPause();
Tapdaq.getInstance().onPause(this);
}
@Override
protected void onResume() {
super.onResume();
Tapdaq.getInstance().onResume(this);
}