如何使用react-native实现Android Playstore应用内更新

问题描述 投票:4回答:1

immediate flow of play store in-app updates

如何使用我的react-native应用程序实现Play商店应用内更新,该应用已经在Play商店中直播了?

我已经通过API调用实现了代码推送和内部版本检查,以强制用户更新应用程序。

[使用Codepush:代码推送仅适用于javascript更改。但是,在许多情况下,当发生本地代码更改时,我们将需要更新整个应用程序。

使用API​​检查:我们需要注意更新何时生效,并更新后端保存的版本号以强制用户更新应用。

尽管这两种解决方案都是零散的,但我想实现优雅的Play商店应用内更新方法,但找不到有关如何完成它的线索。

android react-native
1个回答
0
投票

还有一个选项(比APi检查更好):在Play商店中检查最新版本,并通过https://github.com/kimxogus/react-native-version-check

采取相应措施
VersionCheck.needUpdate()
  .then(async res => {
    console.log(res.isNeeded);    // true
    if (res.isNeeded) {
      Linking.openURL(await VersionCheck.getStoreUrl());  // open store if update is needed.
    }
  });
© www.soinside.com 2019 - 2024. All rights reserved.