react-native-update 10.36.0 → 10.36.2
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.
|
@@ -44,13 +44,17 @@ public class UpdateContext {
|
|
|
44
44
|
String storedPackageVersion = this.sp.getString("packageVersion", null);
|
|
45
45
|
String storedBuildTime = this.sp.getString("buildTime", null);
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
|
|
48
|
+
SharedPreferences.Editor editor = this.sp.edit();
|
|
49
|
+
if (storedPackageVersion == null) {
|
|
50
50
|
editor.putString("packageVersion", packageVersion);
|
|
51
|
-
editor.putString("buildTime", buildTime);
|
|
52
51
|
editor.apply();
|
|
53
52
|
storedPackageVersion = packageVersion;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (storedBuildTime == null) {
|
|
56
|
+
editor.putString("buildTime", buildTime);
|
|
57
|
+
editor.apply();
|
|
54
58
|
storedBuildTime = buildTime;
|
|
55
59
|
}
|
|
56
60
|
|
|
@@ -60,15 +64,10 @@ public class UpdateContext {
|
|
|
60
64
|
if (packageVersionChanged || buildTimeChanged) {
|
|
61
65
|
// Execute cleanUp before clearing SharedPreferences to avoid race condition
|
|
62
66
|
this.cleanUp();
|
|
63
|
-
|
|
64
|
-
SharedPreferences.Editor editor = sp.edit();
|
|
65
67
|
editor.clear();
|
|
66
68
|
editor.putString("packageVersion", packageVersion);
|
|
67
69
|
editor.putString("buildTime", buildTime);
|
|
68
|
-
|
|
69
|
-
// This prevents race condition where getBundleUrl() might read null values
|
|
70
|
-
// if called before apply() completes
|
|
71
|
-
editor.commit();
|
|
70
|
+
editor.apply();
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
|
package/ios/RCTPushy/RCTPushy.mm
CHANGED
|
@@ -78,10 +78,13 @@ RCT_EXPORT_MODULE(RCTPushy);
|
|
|
78
78
|
NSString *storedBuildTime = [defaults stringForKey:paramBuildTime];
|
|
79
79
|
|
|
80
80
|
// If stored versions don't exist, write current versions first
|
|
81
|
-
if (!storedPackageVersion
|
|
81
|
+
if (!storedPackageVersion) {
|
|
82
82
|
[defaults setObject:curPackageVersion forKey:paramPackageVersion];
|
|
83
|
-
[defaults setObject:curBuildTime forKey:paramBuildTime];
|
|
84
83
|
storedPackageVersion = curPackageVersion;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (!storedBuildTime) {
|
|
87
|
+
[defaults setObject:curBuildTime forKey:paramBuildTime];
|
|
85
88
|
storedBuildTime = curBuildTime;
|
|
86
89
|
}
|
|
87
90
|
|