ReactNative
Only supports Android and iOS
Only supports Android and iOS
Please note that when integrating SDK products provided by the TrustDecision in the APP of your company:
1.1 According to the user's information protection regulations, before your users start the App for the first time and start collecting information, your company should fully inform the user of the purpose, method, and scope of collecting, using, and sharing the user's personal information with a third party through an interactive interface or design (such as a pop-up window of the privacy policy), and obtain the express consent of the end user.
1.2 To provide business security and risk control services to your company, the TrustDecision SDK will collect, process, and use the identification information IDFA, AndroidID, OAID, MAC address, Wireless IP address, WIFI list, wireless router identification (BSSID, SSID), device type, device model, system type, geographical location(Rough location information, precise location information), login IP address and other device information of the user's device. To ensure compliance with your use of related services, the aforementioned privacy policy should cover the authorization of TrustDecision SDK to provide services and collect, process, and use relevant information. The following terms are for your reference. The specific expression can be determined by your company according to the overall framework and content of your privacy agreement:
TrustDecision SDK: For business security and risk control, our company uses the TrustDecision SDK. The SDK needs to obtain the information of your devices, such as IDFA, AndroidID, OAID, GAID, MAC address, Wireless IP address, WIFI list, wireless router identification (BSSID, SSID), device type, device model, system type, geographical location(Rough location information, precise location information), login IP address, application list, running process, network type, device software version, sensor information(light sensor, gravity sensor, magnetic field sensor, acceleration sensor, gyroscope sensor) and other related device information, for fraud risk identification.
Privacy Protocol: TrustDecision Privacy Policy
Please execute in your react native project root directory
npm install --save react-native-trustdevice@1.1.4Declare the following permissions in the AndroidManifest.xml file under the application module
<manifest>
<!-- required -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<!-- Outside the Chinese Mainland -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<!--optional, If not declared, some device information will be abandoned -->
<uses-permission android:name=
const TrustDeviceSe = NativeModules.TrustDeviceSe;try {
var options = {
partner: "[Your partner]",
appKey: "[Your appKey]",
appName: "[Your appName]",
country: "[Your data center]",
debug: false,
};
const isDebugMode = __DEV__;
// !!! If not set this parameter in DEBUG mode, the app will terminate
if (isDebugMode) {
options
try {
// Get DeviceInfo in business process
const result = await TrustDeviceSe.getDeviceInfo();
if (result) {
if (reslut["code"] == 0) {
console.log(result);
} else {
console.log(result["msg"]);
A response code of 0 in result['code'] signifies successful device information acquisition. The getDeviceInfo() function returns response data containing the following fields. The sealedResult field is exclusively provided when Sealed Client Results functionality is activated.
The corresponding code and msg values are as follows:
TrustDeviceSe.getSDKVersion();If Android requires obfuscation packaging using ProGuard, add the following code to the ProGuard configuration file:
-keep class com.trustdecision.**{*;}mangetic_field_sensor、gyroscope_sensor、light_sensor、accelerator_data、gravity_data |
readPhone | Whether to collect READ_PHONE_STATE permission related information. Default: collected | Android | options["readPhone"] = true | country_iso、carrier、network_operator、sim_operator、phone_type、radio_type、device_svn |
installPackageList | Whether to collect installed package list. Default: collected | Android | options["installPackageList"] = true | installed_packages |
OAID | Whether to collect OAID. Default: collected | Android | options["OAID"] = false | oaid |
AID | Whether to collect AID. Default: collected | Android | options["AID"] = false | aid |
ANDROID_ID | Whether to collect ANDROID_ID. Default: collected | Android | options["ANDROID_ID"] = false | androidid |
customMessage | Custom message. SDK supports passthrough and storage | All | options["customMessage"] = "" |