react-native-update 10.3.0-beta.0 → 10.3.0
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.
- package/android/src/main/java/cn/reactnative/modules/update/UpdateContext.java +0 -7
- package/android/src/main/java/cn/reactnative/modules/update/UpdateModuleImpl.java +0 -17
- package/android/src/newarch/cn/reactnative/modules/update/UpdateModule.java +1 -6
- package/android/src/oldarch/cn/reactnative/modules/update/UpdateModule.java +0 -12
- package/ios/RCTPushy/RCTPushy.mm +0 -18
- package/package.json +4 -8
- package/src/NativePushy.ts +1 -2
- package/src/core.ts +1 -1
- package/tea.yaml +0 -6
|
@@ -166,13 +166,6 @@ public class UpdateContext {
|
|
|
166
166
|
return sp.getString(key, null);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
public void setBlockUpdate(int until, String reason) {
|
|
170
|
-
SharedPreferences.Editor editor = sp.edit();
|
|
171
|
-
editor.putInt("blockUntil", until);
|
|
172
|
-
editor.putString("blockReason", reason);
|
|
173
|
-
editor.apply();
|
|
174
|
-
}
|
|
175
|
-
|
|
176
169
|
public String getCurrentVersion() {
|
|
177
170
|
return sp.getString("currentVersion", null);
|
|
178
171
|
}
|
|
@@ -192,23 +192,6 @@ public class UpdateModuleImpl {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
public static void setBlockUpdate(UpdateContext updateContext, ReadableMap options,Promise promise) {
|
|
196
|
-
try {
|
|
197
|
-
final int until = options.getInt("until");
|
|
198
|
-
final String reason = options.getString("reason");
|
|
199
|
-
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
200
|
-
@Override
|
|
201
|
-
public void run() {
|
|
202
|
-
updateContext.setBlockUpdate(until, reason);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
promise.resolve(true);
|
|
206
|
-
}catch (Exception e){
|
|
207
|
-
promise.reject("执行报错:"+e.getMessage());
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
195
|
public static void setUuid(UpdateContext updateContext, String uuid, Promise promise) {
|
|
213
196
|
try {
|
|
214
197
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
@@ -14,7 +14,7 @@ import java.io.File;
|
|
|
14
14
|
import java.util.HashMap;
|
|
15
15
|
import java.util.Map;
|
|
16
16
|
|
|
17
|
-
public class UpdateModule extends
|
|
17
|
+
public class UpdateModule extends NativePushySpec {
|
|
18
18
|
UpdateContext updateContext;
|
|
19
19
|
public static ReactApplicationContext mContext;
|
|
20
20
|
public UpdateModule(ReactApplicationContext reactContext, UpdateContext updateContext) {
|
|
@@ -108,11 +108,6 @@ public class UpdateModule extends NativeUpdateSpec {
|
|
|
108
108
|
UpdateModuleImpl.markSuccess(updateContext,promise);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
@Override
|
|
112
|
-
public void setBlockUpdate(ReadableMap options,Promise promise) {
|
|
113
|
-
UpdateModuleImpl.setBlockUpdate(updateContext,options,promise);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
111
|
@Override
|
|
117
112
|
public void setUuid(final String uuid, Promise promise) {
|
|
118
113
|
UpdateModuleImpl.setUuid(updateContext,uuid,promise);
|
|
@@ -239,18 +239,6 @@ public class UpdateModule extends ReactContextBaseJavaModule {
|
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
@ReactMethod
|
|
243
|
-
public void setBlockUpdate(ReadableMap options) {
|
|
244
|
-
final int until = options.getInt("until");
|
|
245
|
-
final String reason = options.getString("reason");
|
|
246
|
-
UiThreadUtil.runOnUiThread(new Runnable() {
|
|
247
|
-
@Override
|
|
248
|
-
public void run() {
|
|
249
|
-
updateContext.setBlockUpdate(until, reason);
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
242
|
@ReactMethod
|
|
255
243
|
public void setUuid(final String uuid) {
|
|
256
244
|
UiThreadUtil.runOnUiThread(new Runnable() {
|
package/ios/RCTPushy/RCTPushy.mm
CHANGED
|
@@ -192,24 +192,6 @@ RCT_EXPORT_MODULE(RCTPushy);
|
|
|
192
192
|
return self;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
RCT_EXPORT_METHOD(setBlockUpdate:(NSDictionary *)options
|
|
196
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
197
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
198
|
-
{
|
|
199
|
-
// NSMutableDictionary *blockUpdateInfo = [NSMutableDictionary new];
|
|
200
|
-
// blockUpdateInfo[@"reason"] = options[@"reason"];
|
|
201
|
-
// blockUpdateInfo[@"until"] = options[@"until"];
|
|
202
|
-
@try {
|
|
203
|
-
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
|
204
|
-
[defaults setObject:options forKey:keyBlockUpdate];
|
|
205
|
-
[defaults synchronize];
|
|
206
|
-
resolve(@true);
|
|
207
|
-
}
|
|
208
|
-
@catch (NSException *exception) {
|
|
209
|
-
reject(@"执行报错", nil, nil);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
195
|
RCT_EXPORT_METHOD(setUuid:(NSString *)uuid resolver:(RCTPromiseResolveBlock)resolve
|
|
214
196
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
215
197
|
{
|
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.0",
|
|
4
4
|
"description": "react-native hot update",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -48,13 +48,9 @@
|
|
|
48
48
|
"nanoid": "^3.3.3"
|
|
49
49
|
},
|
|
50
50
|
"codegenConfig": {
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"type": "modules",
|
|
55
|
-
"jsSrcsDir": "src"
|
|
56
|
-
}
|
|
57
|
-
]
|
|
51
|
+
"name": "RCTPushySpec",
|
|
52
|
+
"type": "modules",
|
|
53
|
+
"jsSrcsDir": "src"
|
|
58
54
|
},
|
|
59
55
|
"devDependencies": {
|
|
60
56
|
"@babel/core": "^7.24.0",
|
package/src/NativePushy.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
1
|
+
import { TurboModule, TurboModuleRegistry } from 'react-native';
|
|
3
2
|
|
|
4
3
|
export interface Spec extends TurboModule {
|
|
5
4
|
getConstants: () => {
|
package/src/core.ts
CHANGED