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

rnkit-in-app-update

v1.0.0

Published

InApp Update for react-native

Downloads

12

Readme

npm react-native MIT bitHound Score Downloads

InApp Update 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 rnkit-in-app-update and link it manually (see below).

Android

  • React Native < 0.29 (Using rnpm)

    rnpm install rnkit-in-app-update

  • React Native >= 0.29

    $npm install -S rnkit-in-app-update

    $react-native link rnkit-in-app-update

Manually

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

Finally, you're good to go, feel free to require rnkit-in-app-update in your JS files.

Have fun! :metal:

Basic Usage

Import library

import InAppUpdate from 'rnkit-in-app-update'

Contribution

Thanks

@yjfnypeu - UpdatePlugin

Api

/**
 * 获取安卓的metadata信息, 主要用于获取渠道号
 * @param {String} [required] key 对应的key
 */
async getAppMetaData(key);

/**
 * 下载Apk文件
 * @param {Object} options 下载参数
 * ------- options ---------
 * @param {String} [required] url apk 下载地址
 * @param {String} [required] version 版本号
 * @param {String} algorithm 可选(md5, etag), 当文件下载完成后会返回对应的值
 * @param {Bool} isForce 为true的情况下,会忽略网络条件和下载策略
 * @param {Bool} strategy 0默认,表示只判断当前环境,如果是wifi就下载,否则就不下载, 1表示监听wifi,如果当前是wifi就下载,如果当前不是wifi,就监听网络变化,如果在程序运行期间,切换到了wifi,就提示用户下载
 */
downloadApk(options);

/**
 * 安卓应用
 */
installApk();

/**
 * 暂停下载
 * 调用此方法, 系统会发送事件RNKitApkDownloadPause, type: manual
 */
pauseDownload();

/**
 * 继续下载
 */
downloadResume();

--------------- 新增事件回调 ------------
开始下载: RNKitApkStartDownload
下载进度: RNKitApkDownloadProgress, return params{received, total}
下载错误: RNKitApkDownloadError, return params{errorMsg}
下载被暂停了: RNKitApkDownloadPause, return params{type}, type: (manual, network)
下载完成了: RNKitApkDownloadComplete, return params{md5, etag, path, success}

Questions

Feel free to contact me or create an issue

made with ♥