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

tnrn-bqs-device-finger-printing

v1.0.1

Published

BqsDeviceFingerPrinting for react-native

Downloads

19

Readme

npm react-native MIT bitHound Score Downloads

BqsDeviceFingerPrinting for react-native for React Native.

Support me with a Follow

Getting Started

First, cd to your RN project directory, and install RNMK through rnpm . If you don't have rnpm, you can install RNMK from npm with the command npm i -S tnrn-bqs-device-finger-printing and link it manually (see below).

Android

  • React Native < 0.29 (Using rnpm)

    rnpm install tnrn-bqs-device-finger-printing

  • React Native >= 0.29

    $npm install -S tnrn-bqs-device-finger-printing

    $react-native link tnrn-bqs-device-finger-printing

Manually

  1. JDK 7+ is required
  2. Add the following snippet to your android/settings.gradle:
include ':tnrn-bqs-device-finger-printing'
project(':tnrn-bqs-device-finger-printing').projectDir = new File(rootProject.projectDir, '../node_modules/tnrn-bqs-device-finger-printing/android/app')
  1. Declare the dependency in your android/app/build.gradle
dependencies {
    ...
    compile project(':tnrn-bqs-device-finger-printing')
}
  1. Import import io.rnkit.bqs.devicefingerprinting; and register it in your MainActivity (or equivalent, RN >= 0.32 MainApplication.java):
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.asList(
            new MainReactPackage(),
            new BqsDeviceFingerPrintingPackage()
    );
}

Finally, you're good to go, feel free to require tnrn-bqs-device-finger-printing in your JS files.

Have fun! :metal:

Basic Usage

Import library

import BqsDeviceFingerPrinting from 'tnrn-bqs-device-finger-printing'

Authentication

iOS

Privacy - Location When In Use Usage Description: 我们需要通过您的地理位置信息获取您周边的相关数据
Privacy - Contacts Usage Description: 是否允许此App访问你的通讯录?

Android

<!--必要权限-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!--采集传感器信息必要权限-->
<uses-feature android:required="true" android:name="android.hardware.sensor.accelerometer"/>
<!--可选权限 如果需要获取 GPS 定位,需要添加以下两个可选权限-->
<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_CONTACTS" />
<!--获取通话记录-->
<uses-permission android:name="android.permission.READ_CALL_LOG"/>

Api

/**
 * 初始化方法
 * @param {Object} options 参数
 * ------- options ---------
 * @param {String} [required] partnerId 合作方编码
 * @param {Boolen} isGatherGps 是否采集gps,默认YES:采集 NO:不采集
 * @param {Boolen} isGatherContacts 是否采集通讯录,默认NO:不采集, YES:采集
 * @param {Boolen} isTestingEnv 是否对接白骑士测试环境,默认NO:生产环境, YES:测试环境
 * @param {Boolen} isGatherSensorInfo 是否采集传感器信息,默认YES:采集 NO:不采集
 */
try {
  const token = await BqsDeviceFingerPrinting.init({
    partnerId: 'partnerId',
    isGatherGps: true,
    isGatherContacts: false,
    isTestingEnv: true,
    isGatherSensorInfo: true,
  });
  console.log(`deviceToken: ${token}`);
} catch (err) {
  console.log(err);
}

/**
 * 获取 tokenKey
 * @return {String} token
 */
[async] getTokenKey();

/**
 * 提交通讯录
 * @return {String} token
 */
try {
  const token = await commitContacts();
  console.log(`deviceToken: ${token}, 提交通讯录成功!`)
} catch (err) {
  console.log(err)
}

/**
 * 提交定位 (可能不准)
 * @return {String} token
 */
try {
  const token = await commitLocaiton();
  console.log(`deviceToken: ${token}, 提交定位成功!`)
} catch (err) {
  console.log(err)
}

/**
 * 设置并提交定位
 * @param {double} [required] longitude 经度
 * @param {double} [required] latitude 纬度
 * @return {String} token
 */
try {
  const token = await commitLocaitonWithLongitude(longitude, latitude);
  console.log(`deviceToken: ${token}, 设置并提交定位成功!`)
} catch (err) {
  console.log(err)
}

Questions

create an issue

made with ♥