# Third-party Integration
- Third-party data plugin should be introduced:
implementation 'cn.thinkingdata.android:TAThirdParty:1.0.0'
- The sample codes for the synchronization of multiple platform data are as follows:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER | TDThirdPartyShareType.TD_ADJUST| TDThirdPartyShareType.TD_TRAD_PLUS | TDThirdPartyShareType.TD_TRACKING| TDThirdPartyShareType.TD_TOP_ON | TDThirdPartyShareType.TD_BRANCH| TDThirdPartyShareType.TD_IRON_SOURCE);
enableThirdPartySharing(int var1, Map<String, Object> var2)
, an API that does not support bitwise operation, can be used to add additional parameters.
# AppsFlyer
Call this API before AppsFlyer SDK calls the Start API:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER)
After the created role is registered (optional):
instance.login("account_id")
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER)
Every time you call the login
or identify
, you need to call enableThirdPartySharing
synchronously to update the user ID.
Note: Since AppFlyer's setAdditionalData
is called each time, the user ID will be overwritten. You can set parameters via the enableThirdPartySharing
API we provide:
Map<String, Object> additionalData = new HashMap<>();
additionalData.put("af_test_key1", "test1");
additionalData.put("af_test_key2", "test2");
AppsFlyerLib.getInstance().setAdditionalData(additionalData);
Since previous parameters would be replaced if setAdditionalData is called multiple times, the parameters could be transmitted to TE, and the TE SDK would merge the parameters.
Map<String, Object> additionalData = new HashMap<>();
additionalData.put("af_test_key1", "test1");
additionalData.put("af_test_key2", "test2");
instance.enableThirdPartySharing(
TDThirdPartyShareType.TD_APPS_FLYER,
additionalData
)
# Adjust
To be called before Adjust SDK initialization:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_ADJUST)
After the created role is registered (optional):
instance.login("accoount_id")
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_ADJUST)
# 3.Branch
To be called before the Branch initialize the session:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_BRANCH)
After the created role is registered (optional):
instance.login("accoount_id")
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_BRANCH)
# 4.TopOn
To be called before ATSDK.init:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TOP_ON)
Every time you call the login
or identify
, you need to call enableThirdPartySharing
synchronously to update the user ID.
Note: Since TopOn's initCustomMap
is called each time, the user ID will be overwritten. You can set parameters via the enableThirdPartySharing
API we provide:
Map<String, Object> customMap = new HashMap<>();
customMap.put("key1", "value1");
customMap.put("key2", "value2");
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TOP_ON, customMap)
# 5.ReYun
To be called after the account is registered:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TRACKING)
# 6.TradPlus
To be called before TradPlus SDK initialization:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_TRAD_PLUS)
# 7.IronSource
To be called after IronSource Sdk initialization:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_IRON_SOURCE)
# 8.AppLovin
- User Revenue API
To be called before AppLovin SDK initialization:
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPLOVIN_IMPRESSION)
- Impression-Level User Revenue API
If you want to achieve monetization data acquisition, you need to create a MaxAdRevenueListener
,and rewrite the onAdRevenuePaid
.In this method, the monetization data is obtained and the data is reported through the enableThirdPartySharing
of the TA SDK,
finally, the listener is passed to setRevenueListener(). The sample code is as follows:
void onAdRevenuePaid(final MaxAd ad){
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPLOVIN_USER,ad)
}