• Stars
    star
    428
  • Rank 101,481 (Top 2 %)
  • Language
    Java
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

react native 版本升级

React Native App 版本升级封装库,兼容Android4以上所有版本

⚠️ 如遇到lStar编译失败问题,请将build & target version 改成 31

一、功能

Android

(1)版本检测
(2)下载更新
(3)进度提示
(4)自动安装

iOS

(1)版本检测
(2)自动跳转App Store

二、使用

  yarn add rn-app-upgrade

  // or 
  npm install rn-app-upgrade
 
  // less than 0.6
  react-native link rn-app-upgrade

iOS 打开Xcode, 将 ios_upgrade 导入到项目目录。

  import { 
    downloadApk,
    versionName,
    versionCode,
    openAPPStore,
    checkIOSUpdate,
    addDownLoadListener,
  } from 'rn-app-upgrade';
  
  //可通过RN.versionName获取apk版本号和远程版本号进行比较
  if(Android) {
    if(res.versionCode > versionCode) {
        downloadApk({
            interval: 666, // listen to upload progress event, emit every 666ms
            apkUrl: "https://xxxx.apk",
            downloadInstall: true,
            callback: {
                onProgress: (received, total, percent) => {},
                onFailure: (errorMessage, statusCode) => {},
                onComplete: () => {},
            },
        });
    }
  } else {
    const IOSUpdateInfo = await checkIOSUpdate(appid, 当前版本号);
    IOSUpdateInfo.code // -1: 未查询到该App 或 网络错误 1: 有最新版本 0: 没有新版本
    IOSUpdateInfo.msg
    IOSUpdateInfo.version
  }

More Repositories

1

visitor-flutter

flutter 视频类客户端
Dart
724
star
2

ReactNativeApp

react native 超级 App
Java
653
star
3

react-native-share

react native 分享
Objective-C
451
star
4

ComicApp

[停止维护] 基于 ReactNative、Redux 的漫画书App,支持Android、iOS 平台.
JavaScript
379
star
5

react-native-baidu-face

基于百度人脸识别封装的react-native模块,支持Android、iOS平台设备
Java
96
star
6

EncryptionLib

🔥DES 3DES AES XOR SHA Base64 RAS 8种加密工具Android lib库
Java
88
star
7

react-native-split-bundle

react native jsbundle 拆包解决方案,实现 react context 延迟异步加载,基础包、业务包按需加载
JavaScript
69
star
8

react-native-gifview

🌹react native gif图插件.支持动态加载、播放、暂停.【 Android | iOS 】
Objective-C
59
star
9

SuperVideoView

Android video and audio player VideoView package, add gesture control.
Java
33
star
10

react-navigation-redux

react-navigation integrates with Redux
JavaScript
22
star
11

flutter-android-hybrid

Android & Flutter 混合开发实践,包含 Android集成Flutter、Flutter视图加载、交互通信。
Java
20
star
12

react-native-feedback

Based on Alibaba Cloud packaged react-native user feedback platform, support for Android, iOS. Easily integrated, one line of code to get user feedback
Objective-C
16
star
13

LessItemFoldLayout

Android ItemFoldLayout, custom wrapper animation effects. Use the scene: User Setting
Java
16
star
14

loadinglayout

Android LoadingLayout, customizable Gif chart, rounded border, background
Java
14
star
15

react-native-touch-responder

react native 触摸事件机制详解,及高仿微信通讯录功能。
JavaScript
13
star
16

react-native-isomorphism

react native 三端同构
JavaScript
8
star
17

react-native-network

JavaScript
6
star
18

react-native-app-font

A solution for setting up React Native fonts without using system fonts (font scaling, font styles).
JavaScript
5
star
19

native-read-rn-image

native-read-rn-image
Java
4
star
20

CustomDrawableTextView

在TextView中设置drawable时,可以自定义图片大小的TextView。
Java
4
star
21

tangram

react native super video player
3
star
22

CircleImage

可定制边框效果的圆角图
Java
3
star
23

genebox-mini-request

genebox-mini-request 是一个基于JS Decorator 和 Taro 实现的网络请求库,专注于网络请求技术方案。
TypeScript
3
star
24

rn-sdr

react-native 服务驱动渲染实践
JavaScript
3
star
25

PullTextView

徐徐展开的TextView
Java
2
star
26

SuspendeRecyclerView

RecyclerView 悬浮窗提示效果封装
Java
2
star
27

IphoneHelper

Iphone 机型适配工具类
JavaScript
2
star
28

DayNightManager

一款用于Android App 白天与夜间主题模式切换的工具。
2
star
29

react-native-svg-icon

A beautiful solution for loading svg icons in react-native
JavaScript
2
star
30

react-native-code-push-assets

react-native-code-push-assets
Java
2
star
31

react-hook-state-manager

自定义状态管理库
JavaScript
1
star
32

flutter_weather

flutter 天气app, 使用最新版本状态管理工具: Provider4.x
Dart
1
star
33

genebox-mini-server

miniprogram-cli + puppteer 实现小程序持续交付
TypeScript
1
star
34

react-native-plugin

react native 插件化开发实现方案
TypeScript
1
star