npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-trustdevice

v1.1.1

Published

React Native TrustDevice component

Downloads

279

Readme

Integrated Requirement

Compliance Explanation

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:

Privacy Protocol: https://www.trustdecision.com/legal/privacy-policy

Environment

| | Android | iOS | | ------------------------- | ------------------------------------ | :----------------- | | Supported System Versions | Android 5.0 and above | iOS 9.0 and above | | Supported Architectures | armeabi, armeabi-v7a, arm64-v8a, x86 | armv7,arm64,x86_64 |

Integrate

Install

Plugin Install

Please execute in your react native project root directory

  npm install --save [email protected]

AndroidManifest.xml

Declare 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="android.permission.ACCESS_COARSE_LOCATION"/>
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.READ_PHONE_STATE" />
   <!-- required for Android 11 and above to obtain the installed packages -->
   <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
        tools:ignore="QueryAllPackagesPermission" />
</manifest>

Permissions

| Name | Description | | ---------------------------------- | ------------------------------------------------------------------------------------------------- | | INTERNET(required) | Allows the app to access the network connection and send requests to communicate with the server. | | ACCESS_NETWORK_STATE(required) | Collect network connection status information. | | ACCESS_WIFI_STATE(required) | Collect the current WiFi access status and WLAN hotspot information. | | AD_ID(required) | Collect the Google advertising ID, required outside the Chinese Mainland. | | ACCESS_COARSE_LOCATION | Get location information, with an accuracy of approximately 30 to 1500 meters. | | ACCESS_FINE_LOCATION | Get location information, with positioning accuracy within 10 meters. | | READ_PHONE_STATE | Collect information on SIM card | | QUERY_ALL_PACKAGES | Collect installed packages |

Initialization

Cautions

  • Ensure that it is initialized after the user agrees to the privacy agreement.

Definition

   async function initWithOptions(options: {[key: string]: any})

Get blackBox

Cautions

  • Call getBlackBox after initWithOptions.
  • Don't cache blackBox returned by getBlackBox in the app. Please rely on this function to get blackBox.

Definition

  // get by synchronous call 
  async function getBlackBox();
  // get by asynchronous call
  async function getBlackBoxAsync();

Best Practices

  1. Get TrustDevice Module
  const TrustDevice = NativeModules.TrustDevice;
  1. Initialize and get blackBox
  async function initWithOptions() {

    var options = {
      "partner": "[Your partner]",
      "appKey": "[Your appKey]",
      "appName": "[Your appName]",
      "country": "[Your country code]",
      "debug": false, 
    }

    const isDebugMode = __DEV__;
    // !!! If not set this parameter in DEBUG mode, the app will terminate
    if (isDebugMode) {
      options["debug"] = true;
    }

     TrustDevice.initWithOptions(options);
     const blackBox = await TrustDevice.getBlackBoxAsync()
  }
  1. Obtain blackBox in actual business scenarios
  async function register() {
    const blackBox = await TrustDevice.getBlackBox()
    // ...
  }

Status Check

  1. getBlackBox() will return a 26-bit string while initialization successfully: rGPGX1678775227I9NCwcuVJCb
  2. getBlackBox() will return a string of around 5000 bits while initialization Failed, please refer to overview-definition

Other

Get SDK Version

  async function getSDKVersion();

Keep Configuration

-keep class cn.tongdun.**{*;}
-keep class com.trustdecision.**{*;}

All Configuration

| Key | Description | 平台 | Sample | | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------ | | partner(required) | Partner code, contact operator to obtain. | All | options["partner"] = "your partner" | | appKey(required) | Application identification, please refer tohow to get appKey | All | options["appKey"] = "your appKey" | | country(required) | Data-center: cn for China fra for Europe sg for Singapore inda for Indonesia us for the USA | All | options["country"] = "your country" | | appName | Application name, contact operator to obtain | All | options["appName"] = "your appName" | | debug | Allow debugging, default false, must be closed before the application release. | All | options["debug"] = true | | timeLimit | Network timeout configuration, in seconds, default 15s | All | options["timeLimit"] = 5 | | location | whether collecting GPS location information, default allowed | All | options["location"] = true | | collectLevel | You can set M to control the maximum length of blackBox to 2000, default around 5000 | All | options["collectLevel"] = "M" | | IDFA | Whether collecting IDFA information, default allowed | iOS | options["IDFA"] = true | | deviceName | Whether collecting device name, default allowed | iOS | options["deviceName"] = true | | runningTasks | Whether collecting running tasks, default allowed | Android | options["runningTasks"] = true | | sensor | Whether collecting sensor information, default allowed | Android | options["sensor"] = true | | readPhone | Whether collecting READ PHONE STATE permission-related information, default allowed | Android | options["readPhone"] = true | | installPackageList | Whether collecting application list information, default allowed | Android | options["installPackageList"] = true |