react-native-update 10.3.0 → 10.3.1

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.
@@ -69,13 +69,6 @@ public class UpdateContext {
69
69
  return context.getString(R.string.pushy_build_time);
70
70
  }
71
71
 
72
- public Map getBlockUpdate() {
73
- return new HashMap<String, Object>() {{
74
- put("until", sp.getInt("blockUntil", 0));
75
- put("reason", sp.getString("blockReason", null));
76
- }};
77
- }
78
-
79
72
  public boolean getIsUsingBundleUrl() {
80
73
  return isUsingBundleUrl;
81
74
  }
@@ -45,7 +45,6 @@ public class UpdateModule extends NativePushySpec {
45
45
  if (rolledBackVersion != null) {
46
46
  updateContext.clearRollbackMark();
47
47
  }
48
- constants.put("blockUpdate", updateContext.getBlockUpdate());
49
48
  constants.put("uuid", updateContext.getKv("uuid"));
50
49
  return constants;
51
50
  }
@@ -59,7 +59,6 @@ public class UpdateModule extends ReactContextBaseJavaModule {
59
59
  if (rolledBackVersion != null) {
60
60
  updateContext.clearRollbackMark();
61
61
  }
62
- constants.put("blockUpdate", updateContext.getBlockUpdate());
63
62
  constants.put("uuid", updateContext.getKv("uuid"));
64
63
  return constants;
65
64
  }
@@ -16,7 +16,6 @@ static NSString *const paramLastVersion = @"lastVersion";
16
16
  static NSString *const paramCurrentVersion = @"currentVersion";
17
17
  static NSString *const paramIsFirstTime = @"isFirstTime";
18
18
  static NSString *const paramIsFirstLoadOk = @"isFirstLoadOK";
19
- static NSString *const keyBlockUpdate = @"REACTNATIVECN_PUSHY_BLOCKUPDATE";
20
19
  static NSString *const keyUuid = @"REACTNATIVECN_PUSHY_UUID";
21
20
  static NSString *const keyHashInfo = @"REACTNATIVECN_PUSHY_HASH_";
22
21
  static NSString *const keyFirstLoadMarked = @"REACTNATIVECN_PUSHY_FIRSTLOADMARKED_KEY";
@@ -157,7 +156,6 @@ RCT_EXPORT_MODULE(RCTPushy);
157
156
  ret[@"buildTime"] = [RCTPushy buildTime];
158
157
  ret[@"rolledBackVersion"] = [defaults objectForKey:keyRolledBackMarked];
159
158
  ret[@"isFirstTime"] = [defaults objectForKey:keyFirstLoadMarked];
160
- ret[@"blockUpdate"] = [defaults objectForKey:keyBlockUpdate];
161
159
  ret[@"uuid"] = [defaults objectForKey:keyUuid];
162
160
  NSDictionary *pushyInfo = [defaults dictionaryForKey:keyPushyInfo];
163
161
  ret[@"currentVersion"] = [pushyInfo objectForKey:paramCurrentVersion];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.3.0",
3
+ "version": "10.3.1",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
package/src/provider.tsx CHANGED
@@ -124,20 +124,20 @@ export const PushyProvider = ({
124
124
  setUpdateInfo(info);
125
125
  if (info.expired) {
126
126
  const { downloadUrl } = info;
127
- showAlert('提示', '您的应用版本已更新,点击更新下载安装新版本', [
128
- {
129
- text: '更新',
130
- onPress: () => {
131
- if (downloadUrl) {
127
+ if (downloadUrl) {
128
+ showAlert('提示', '您的应用版本已更新,点击更新下载安装新版本', [
129
+ {
130
+ text: '更新',
131
+ onPress: () => {
132
132
  if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) {
133
133
  downloadAndInstallApk(downloadUrl);
134
134
  } else {
135
135
  Linking.openURL(downloadUrl);
136
136
  }
137
- }
137
+ },
138
138
  },
139
- },
140
- ]);
139
+ ]);
140
+ }
141
141
  } else if (info.update) {
142
142
  showAlert(
143
143
  '提示',