react-native-ota-hot-update 2.1.0 → 2.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,7 @@ import com.facebook.react.module.model.ReactModuleInfoProvider
12
12
  import com.rnhotupdate.Common.CURRENT_VERSION_NAME
13
13
  import com.rnhotupdate.Common.DEFAULT_BUNDLE
14
14
  import com.rnhotupdate.Common.PATH
15
+ import com.rnhotupdate.Common.VERSION
15
16
  import com.rnhotupdate.SharedPrefs
16
17
 
17
18
 
@@ -60,8 +61,13 @@ class OtaHotUpdate(context: Context?) : TurboReactPackage() {
60
61
  }
61
62
  val sharedPrefs = SharedPrefs(mContext!!)
62
63
  val pathBundle = sharedPrefs.getString(PATH)
64
+ val version = sharedPrefs.getString(VERSION)
63
65
  val currentVersionName = sharedPrefs.getString(CURRENT_VERSION_NAME)
64
- if (pathBundle == "" || (!currentVersionName.isNullOrEmpty() && currentVersionName != mContext?.getPackageInfo()?.versionName)) {
66
+ if (pathBundle == "" || (currentVersionName != mContext?.getPackageInfo()?.versionName)) {
67
+ if (version != "") {
68
+ // reset version number because bundle is wrong version, need download from new version
69
+ sharedPrefs.putString(VERSION, "")
70
+ }
65
71
  return DEFAULT_BUNDLE
66
72
  }
67
73
  return pathBundle!!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ota-hot-update",
3
- "version": "2.1.0",
3
+ "version": "2.1.11",
4
4
  "description": "Hot update for react native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -76,6 +76,7 @@
76
76
  "devDependencies": {
77
77
  "@commitlint/config-conventional": "^17.0.2",
78
78
  "@evilmartians/lefthook": "^1.5.0",
79
+ "@expo/config-plugins": "^9.0.15",
79
80
  "@react-native-community/cli": "15.0.1",
80
81
  "@react-native/eslint-config": "^0.73.1",
81
82
  "@release-it/conventional-changelog": "^9.0.2",