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-auto-update-zj

v1.0.0

Published

React Native Android 应用自动更新

Downloads

4

Readme

React Native Auto Update For Android In Notification

React Native Android自动下载更新APK,进度条在通知栏中显示

Getting Started

$ npm install git+http://[email protected]/React-Sextant/react-native-android-auto-update.git

$ react-native link react-native-android-auto-update

v0.1.0 usage

README_old.md

v2.3.0 usage

👉全部的UpdateAppUtils Api说明

import {UpdateApp,UiType} from 'react-native-android-auto-update'

UpdateApp({
  apkUrl:"http://.example.com/demo.apk",
  updateTitle:"发现新版本V2.3.0",
  updateContent:"1、Kotlin重构版\n2、支持自定义UI\n3、增加md5校验\n4、更多功能等你探索",
  force:true,
  uiType:UiType.PLENTIFUL,
  titleTextColor:"red",
  UpdateDownloadListener:(type,msg)=>{
    //@param type: onStart | onDownload | onFinish | onError
    if(type === "onDownload"){
       console.log(msg);   // progress
    }else if(type === "onError"){
       alert(msg);         // error message
    }
  },
  OnBtnClickListener:(type)=>{
    console.log(type);     // onCancelBtnClick, onUpdateBtnClick
    return false;          // 事件是否消费,是否需要传递下去。false-会执行原有点击逻辑,true-只执行本次设置的点击逻辑
  }
});

v2.4.0 usage

  • 完善uiType类型UiType.CUSTOM

    • 如果使用UiType.CUSTOM类型,本库custom ui不能通过RN生成,只能自定义XML实现,
    • 所以默认为对Android有一定基础,没有的话也可以借此机会学习😊,不过本库已为您创建了一个custom xml
    • 如果需要定制化,在本地根android项目中创建一个名为view_update_dialog_custom.xml的Layout文件即可覆盖
    • 文件路径:android / app / src / main / res / layout / view_update_dialog_custom.xml

view_update_dialog_custom.xml元素ID必须按照以下命名

<!--更新标题-->
<TextView android:id="@+id/tv_update_title" />
<!--更新内容-->
<TextView android:id="@+id/tv_update_content" />

<!--apk版本名-->
<TextView android:id="@+id/tv_version_name" />
<!--apk版本号-->
<TextView android:id="@+id/tv_version_code" />

<!--更新按钮文案-->
<TextView android:id="@+id/btn_update_sure" />
<!--取消按钮文案-->
<Button android:id="@+id/btn_update_cancel" />

...