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-qy-library

v1.2.2

Published

native function for android and ios

Downloads

5

Readme

react-native-qy-library

Getting started

$ npm install react-native-qy-library --save

Mostly automatic installation

$ react-native link react-native-qy-library

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-qy-library and add RNQyLibrary.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNQyLibrary.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.qy.RNQyLibraryPackage; to the imports at the top of the file
  • Add new RNQyLibraryPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-qy-library'
    project(':react-native-qy-library').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-qy-library/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-qy-library')

Usage

import RNQyLibrary from 'react-native-qy-library';

// TODO: What to do with the module?
RNQyLibrary;

原生功能调用

系统功能

  • [打开系统设置页面]

  • [app 版本号]

位置信息

  • [获取经纬度]

  • [检查位置信息是否打开]

图片

  • [打开摄像机拍照]

  • [打开图库]

  • [压缩图片]

通讯录

  • [调用通讯录]

  • [获取通讯录信息]

存储

  • [保存 string]

  • [获取 string]

  • [删除 string]

  • [删除所有 string]

android 和 iOS独有

  • [设备信息]

  • [通话记录]

  • [短信记录]

  • [googleAds]

  • [app 版本 code]

  • [检查 app 权限]

  • [设备信息]

  • [检查app权限]

具体调用方法

toSystemSetting()

| 属性 | 说明 | 类型 | 示例 | | ---- | ---------------- | ---- | ---- | | 无 | 打开系统设置界面 | 无 | |

getAppVersion()

| 属性 | 说明 | 类型 | 示例 | | ---- | ---------- | ------ | -------- | | 无 | app 版本号 | string | "v1.0.0" |

getGps(appName: string)

| 属性 | 说明 | 类型 | 示例 | | --------- | -------- | ------- | -------------------- | | success | 权限是否同意 | boolean | true 同意 false 拒绝 | | data | { success: '是否成功(boolean)',latitude: '经度(string)', longitude:'纬度(string)' } | object | | | info | 提示 | string |

checkGpsOpen()

| 属性 | 说明 | 类型 | 示例 | | ---- | -------------------- | ------- | -------------------- | | 无 | 检查位置信息是否打开 | boolean | true 打开 false 关闭 |

openCameraForImage(appName: string) app名称

| 属性 | 说明 | 类型 | 示例 | | ---- | -------- | ------ | ---- | | success | 权限是否同意 | boolean | true 同意 false 拒绝 | | data | 照片路径 | string | | | info | 提示 | string |

openTukuForImage()

| 属性 | 说明 | 类型 | 示例 | | ---- | -------- | ------ | ---- | | 无 | 照片路径 | string | |

compressImage(oldFile: string) 文件地址

| 属性 | 说明 | 类型 | 示例 | | ---- | -------- | ------ | ---- | | 无 | 照片路径 | string | |

openContact(appName: string)

| 属性 | 说明 | 类型 | 示例 | | ------- | -------- | ------- | -------------------- | | success | 权限是否同意 | boolean | true 同意 false 拒绝 | | data | { number: '手机号', name: '姓名'} | string | | info | 提示 | string |

getContactsList(appName: string)

| 属性 | 说明 | 类型 | 示例 | | -------------- | ---------- | ------------ | ------------------------------------------------ | | success | 权限是否同意 | boolean | true 同意 false 拒绝 | | data | 通讯录数据 | (json)string | “[{ "name": "test", phone_number: "342342332"}]” | | (phone_number) | 手机号 | string | | | (name) | 姓名 | string |
| info | 提示 | string |

saveString(key: string, value: string)

| 传入属性 | 说明 | 类型 | 示例 | | -------- | ------------- | ------ | ---- | | key | 存储的 key 值 | string | | | value | 存储的值 | string | |

getString(key: string)

| 传入属性 | 说明 | 类型 | 示例 | | -------- | --------------- | ------ | ---- | | key | 存储的 key 值 | string | | | 输出属性 | 说明 | 类型 | 示例 | | ---- | ---- | ---- | ---- | | 无 | 存储的 value 值 | string | |

removeString(key: string)

| 传入属性 | 说明 | 类型 | 示例 | | -------- | ------------- | ------ | ---- | | key | 存储的 key 值 | string | |

clearString()

| 传入属性 | 说明 | 类型 | 示例 | | -------- | ---- | ---- | ---- |

getDeviceInfoForAndroid()

| 属性 | 说明 | 类型 | 示例 | | --------------- | ---------------- | ------ | ----------------------- | | imei | 设备唯一标识 | string | | | serial | 序列号 | string | | | model | 手机型号 | string | | | wifi | wifi 名称 | string | | | systemVersion | 系统版本号 | string | | | memory | 手机内存 | string | | | totalMemorySize | 手机总存储空间 | string | | | useMemorySize | 手机可用存储空间 | string | | | ipAddress | ip 地址 | string | | | root | 是否 root | string | 返回 是、否 | | macAddress | macd 地址 | string | | | apps | 手机已安装 app | string | '[{ app_name: 'test'}]' | | latitude | 经度 | string | | | longitude | 纬度 | string | |

getAppVersionCodeForAndroid()

| 属性 | 说明 | 类型 | 示例 | | ---- | ------------- | ------ | ---- | | 无 | app 版本 code | number | 1 |

checkPermissionsForAndroid(permission: string[])

| 属性 | 说明 | 类型 | 示例 | | ------ | -------- | ------ | ----------------------------------------- | | success | 权限是否同意 | boolean | true 同意 false 拒绝 | | name | 权限名字 | string | "android.permission.ACCESS_FINE_LOCATION" | | status | 权限状态 | string | "granted" |

toGooglePlayForAndroid()

| 属性 | 说明 | 类型 | 示例 | | ---- | ------------------------------ | ---- | ---- | | 无 | 打开 googleplay 定位到当前 app | 无 | |

getMessageRecordForAndroid()

通过注册订阅事件  监听 回调的 短信记录数据
DeviceEventEmitter.addListener('GetSms', async (res: any) => {
        console.log(res)
      })

| 属性 | 说明 | 类型 | 示例 | | -------- | ------------ | ------------ | ------------------------------------------------- | | success | 是否成功 | boolean | true 成功 false 失败 | | data | 短信记录数据 | (json)string | “[{ ... }]” | | (date) | 日期 | number | | | (number) | 手机号 | string | | | (person) | 姓名 | string | | | (status) | status | string | 短信状态-1 接收,0 complete,64 pending,128 failed | | (type) | 短信类型 | string | 1 是接收到的,2 是已发出 |

getCallRecordForAndroid()

通过注册订阅事件  监听 回调的 通话记录数据
DeviceEventEmitter.addListener('GetCallRecord', async (res: any) => {
        console.log(res)
      })

| 属性 | 说明 | 类型 | 示例 | |----|----|----|----| |success|是否成功| boolean | true成功 false失败 | |data| 短信记录数据 | (json)string | “[{ ... }]” | |(format_number)| 格式化号码 | string | | |(number) | 格式化号码 | string | | |(name) | 联系人名称 | string | | |(location) | 运营商地址 | string | 浙江杭州 | |(type) | 通话类型 | string | | |(duration) | 通话时长(秒为单位) | number | | |(date) | 通话时间 | number | |

getGoogleAdsForAndroid()

通过注册订阅事件  监听 回调的 通话记录数据
DeviceEventEmitter.addListener('GetGoogleAds', async (res: any) => {
        console.log(res)
      })

| 属性 | 说明 | 类型 | 示例 | |----|----|----|----| | 无 | googleAds | string | |

getPermissonInfoForIOS()

| 属性 | 说明 | 类型 | 示例 | |----|----|----|----| |无|相关权限权限| json字典 | {key:value...} | |key|权限名称| string | "photo"/"camera"/"contact"/"location" | |value|权限状态| bool | |

getDeviceInfoForIOS()

| 属性 | 说明 | 类型 | 示例 | |----|----|----|----| |bundleId| App的唯一标识 |string| com.qiyuan.jrn | |serial| 手机唯一标识 |string| | |model| 手机型号|string| | |version| App版本号 |string| | |systemVersion| 系统版本号|string| | |displayName| App名称 |string| |

requestContactForIOS()

| 属性 | 说明 | 类型 | 示例 | |----|----|----|----| |无| 请求通讯录权限结果 | bool ||

requestPhotoForIOS()

| 属性 | 说明 | 类型 | 示例 | |----|----|----|----| |无| 请求相册权限结果 | bool ||

requestCameraForIOS()

| 属性 | 说明 | 类型 | 示例 | |----|----|----|----| |无| 请求相机权限结果 | bool ||