Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-android-auto-update

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-android-auto-update

React Native Android 应用自动更新

  • 2.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Auto Update For Android In Notification

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

Getting Started npm version

$ npm install git+http://git@github.com/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" />

...

Keywords

FAQs

Package last updated on 01 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc