1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 10:21:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Add set local hash info for ios

This commit is contained in:
sunnylqm
2021-10-05 14:08:56 +08:00
parent 775e567062
commit 94d52bb415
8 changed files with 33 additions and 55 deletions

View File

@@ -147,7 +147,7 @@ public class UpdateContext {
String lastVersion = getCurrentVersion();
SharedPreferences.Editor editor = sp.edit();
editor.putString("currentVersion", hash);
if (lastVersion != null && lastVersion != hash) {
if (lastVersion != null && !lastVersion.equals(hash)) {
editor.putString("lastVersion", lastVersion);
}
editor.putBoolean("firstTime", true);
@@ -189,7 +189,8 @@ public class UpdateContext {
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean("firstTimeOk", true);
String lastVersion = sp.getString("lastVersion", null);
if (lastVersion != null) {
String curVersion = sp.getString("currentVersion", null);
if (lastVersion != null && !lastVersion.equals(curVersion)) {
editor.remove("lastVersion");
editor.remove("hash_" + lastVersion);
}