react-native-update 10.29.5 → 10.29.7
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/ios/ImportReact.h +2 -0
- package/ios/RCTPushy/RCTPushy.mm +23 -15
- package/package.json +1 -1
- package/react-native-update.podspec +3 -14
package/ios/RCTPushy/RCTPushy.mm
CHANGED
|
@@ -315,16 +315,15 @@ RCT_EXPORT_METHOD(reloadUpdate:(NSDictionary *)options
|
|
|
315
315
|
if (hash.length) {
|
|
316
316
|
// 只在 setNeedUpdate 成功后 resolve
|
|
317
317
|
[self setNeedUpdate:options resolver:^(id result) {
|
|
318
|
-
// reload in earlier version
|
|
319
318
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
320
|
-
|
|
321
|
-
|
|
319
|
+
#if __has_include("RCTReloadCommand.h")
|
|
320
|
+
// reload 0.62+
|
|
321
|
+
RCTReloadCommandSetBundleURL([[self class] bundleURL]);
|
|
322
|
+
RCTTriggerReloadCommandListeners(@"pushy reloadUpdate");
|
|
323
|
+
#else
|
|
324
|
+
[self.bridge reload];
|
|
325
|
+
#endif
|
|
322
326
|
});
|
|
323
|
-
#if __has_include("RCTReloadCommand.h")
|
|
324
|
-
// reload 0.62+
|
|
325
|
-
RCTReloadCommandSetBundleURL([[self class] bundleURL]);
|
|
326
|
-
RCTTriggerReloadCommandListeners(@"pushy reload");
|
|
327
|
-
#endif
|
|
328
327
|
resolve(@true);
|
|
329
328
|
} rejecter:^(NSString *code, NSString *message, NSError *error) {
|
|
330
329
|
reject(code, message, error);
|
|
@@ -343,13 +342,14 @@ RCT_EXPORT_METHOD(restartApp:(RCTPromiseResolveBlock)resolve
|
|
|
343
342
|
{
|
|
344
343
|
@try {
|
|
345
344
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
346
|
-
|
|
345
|
+
#if __has_include("RCTReloadCommand.h")
|
|
346
|
+
// reload 0.62+
|
|
347
|
+
RCTReloadCommandSetBundleURL([[self class] bundleURL]);
|
|
348
|
+
RCTTriggerReloadCommandListeners(@"pushy restartApp");
|
|
349
|
+
#else
|
|
350
|
+
[self.bridge reload];
|
|
351
|
+
#endif
|
|
347
352
|
});
|
|
348
|
-
#if __has_include("RCTReloadCommand.h")
|
|
349
|
-
// reload 0.62+
|
|
350
|
-
RCTReloadCommandSetBundleURL([[self class] bundleURL]);
|
|
351
|
-
RCTTriggerReloadCommandListeners(@"pushy restartApp");
|
|
352
|
-
#endif
|
|
353
353
|
|
|
354
354
|
resolve(@true);
|
|
355
355
|
}
|
|
@@ -542,7 +542,15 @@ RCT_EXPORT_METHOD(markSuccess:(RCTPromiseResolveBlock)resolve
|
|
|
542
542
|
callback([self errorWithMessage:ERROR_HDIFFPATCH]);
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
|
-
|
|
545
|
+
|
|
546
|
+
@try {
|
|
547
|
+
[_fileManager hdiffFileAtPath:bundlePatch fromOrigin:bundleOrigin toDestination:destination completionHandler:completionHandler];
|
|
548
|
+
}
|
|
549
|
+
@catch (NSException *exception) {
|
|
550
|
+
NSLog(@"Pushy _dopatch error: exception occurred during hdiffFileAtPath: %@, reason: %@",
|
|
551
|
+
exception.name, exception.reason);
|
|
552
|
+
callback([self errorWithMessage:ERROR_HDIFFPATCH]);
|
|
553
|
+
}
|
|
546
554
|
}
|
|
547
555
|
|
|
548
556
|
- (void)patch:(NSString *)hash fromBundle:(NSString *)bundleOrigin source:(NSString *)sourceOrigin callback:(void (^)(NSError *error))callback
|
package/package.json
CHANGED
|
@@ -90,13 +90,6 @@ Pod::Spec.new do |s|
|
|
|
90
90
|
|
|
91
91
|
s.source = { :git => 'https://github.com/reactnativecn/react-native-update.git', :tag => '#{s.version}' }
|
|
92
92
|
|
|
93
|
-
# Conditionally set source files
|
|
94
|
-
if valid_expo_project
|
|
95
|
-
s.source_files = Dir.glob("ios/**/*.{h,m,mm,swift}") # Include Expo files
|
|
96
|
-
else
|
|
97
|
-
s.source_files = Dir.glob("ios/**/*.{h,m,mm,swift}").reject { |f| f.start_with?("ios/Expo/") } # Exclude Expo files
|
|
98
|
-
end
|
|
99
|
-
|
|
100
93
|
s.libraries = 'bz2', 'z'
|
|
101
94
|
s.vendored_libraries = 'RCTPushy/libRCTPushy.a'
|
|
102
95
|
s.pod_target_xcconfig = {
|
|
@@ -112,22 +105,18 @@ Pod::Spec.new do |s|
|
|
|
112
105
|
|
|
113
106
|
# Conditionally add Expo dependency
|
|
114
107
|
if valid_expo_project
|
|
108
|
+
s.public_header_files = ['ios/ImportReact.h']
|
|
115
109
|
s.dependency 'ExpoModulesCore'
|
|
116
110
|
end
|
|
117
111
|
|
|
118
112
|
s.subspec 'RCTPushy' do |ss|
|
|
119
|
-
ss.source_files = 'ios/RCTPushy
|
|
120
|
-
ss.public_header_files = ['ios/RCTPushy/*.h']
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
s.subspec 'HDiffPatch' do |ss|
|
|
124
|
-
ss.source_files = ['ios/RCTPushy/HDiffPatch/**/*.{h,m,c}',
|
|
113
|
+
ss.source_files = ['ios/RCTPushy/**/*.{h,m,mm,c}',
|
|
125
114
|
'android/jni/hpatch.{h,c}',
|
|
126
115
|
'android/jni/HDiffPatch/libHDiffPatch/HPatch/*.{h,c}',
|
|
127
116
|
'android/jni/HDiffPatch/file_for_patch.{h,c}',
|
|
128
117
|
'android/jni/lzma/C/LzmaDec.{h,c}',
|
|
129
118
|
'android/jni/lzma/C/Lzma2Dec.{h,c}']
|
|
130
|
-
ss.public_header_files = 'ios/RCTPushy
|
|
119
|
+
ss.public_header_files = ['ios/RCTPushy/**/*.h']
|
|
131
120
|
end
|
|
132
121
|
|
|
133
122
|
# Conditionally add Expo subspec and check ExpoModulesCore version
|