Migrating from Fraudmetrix to TDMobRisk
With the upgrade of the company's brand, we have made some changes to the API in the SDK. This guide compares the access methods of the new and old versions of the SDK and is used as a guide for customers to migrate from the old version of SDK Fraudmetrix to the new version of SDK TDMobRisk.
Install
SDK
Use Maven Center to rely on integration. Before integration, you must delete fraudmetrix-xxx.aar in the project libs file. Then add dependencies to the app/build.gradle
of the project, as follows:
dependencies {
// device fingerprint
implementation 'com.trustdecision.android:mobrisk:+'
}
Class Name
Some class names in the SDK are renamed
- Entry class
FMAgent
renamed toTDRisk
- Configuration class
TDOption
renamed toTDRiskOption
- Callback method
FMCallback
renamed toTDRiskCallback
Initialization
When the application starts, for example, in the application's onCreate method (Android 6.0 and above versions should ensure that the permission has been applied) call the following method:
The code example is as follows:
TDRisk.Builder builder = new TDRisk.Builder()
.appKey(appKey) //appkey needs to be provided by the operator
.partnerCode(partner) //Partner partners need to provide
.appName(appName) //appName needs to be provided by the operator
.country(TDRisk.COUNTRY_CN) // Country parameters, such as cn, sg, us, fra
TDRisk.initWithOptions(this, builder);
⚠️Note: You must ensure that initWithOptions
is called before getBlackBox
!
Get blackBox
Get blackbox when your business needs it
String blackbox = FMAgent.onEvent(context);
Integration status check
Successful initialization will print the following log in logcat
:
TD_JAVA: Tongdun sdk load success
TD_JAVA: Tongdun sdk init success
⚠️ If there is no above log, please find Call init
in the logcat, and modify your integration method according to the error message.
⚠️Verify whether the integration is successful, you can uninstall and reinstall (to avoid cache impact), and call the SDK to check the returned blackbox, if it is a 26-length string, the integration is successful. If the returned blackbox is longer, it means that there is a problem in the integration process, and the SDK development engineer needs to assist and confirm.