@gfean/react-native-bundle-drop 0.3.7 → 0.3.8
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/BundleDropLocator.h
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#import "BundleDropLocator.h"
|
|
2
|
+
|
|
3
|
+
#if __has_include(<BundleDrop/BundleDrop-Swift.h>)
|
|
4
|
+
#import <BundleDrop/BundleDrop-Swift.h>
|
|
5
|
+
#else
|
|
6
|
+
#import "BundleDrop-Swift.h"
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
@implementation BundleDropLocator
|
|
10
|
+
|
|
11
|
+
+ (nullable NSURL *)bundleURL
|
|
12
|
+
{
|
|
13
|
+
return [BundleDropLocatorCore bundleURL];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
+ (unsigned long long)fileSizeAtURL:(NSURL *)url
|
|
17
|
+
{
|
|
18
|
+
return [BundleDropLocatorCore fileSizeAt:url];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@end
|
|
@@ -14,7 +14,7 @@ final class BundleDropModule: NSObject {
|
|
|
14
14
|
_ resolve: @escaping RCTPromiseResolveBlock,
|
|
15
15
|
rejecter reject: @escaping RCTPromiseRejectBlock
|
|
16
16
|
) {
|
|
17
|
-
if let url =
|
|
17
|
+
if let url = BundleDropLocatorCore.bundleURL() {
|
|
18
18
|
print("📦 Found downloaded bundle at: \(url.path)")
|
|
19
19
|
resolve(url.path)
|
|
20
20
|
return
|
|
@@ -29,7 +29,7 @@ final class BundleDropModule: NSObject {
|
|
|
29
29
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
30
30
|
reject: @escaping RCTPromiseRejectBlock
|
|
31
31
|
) {
|
|
32
|
-
UserDefaults.standard.set(enabled, forKey:
|
|
32
|
+
UserDefaults.standard.set(enabled, forKey: BundleDropLocatorCore.otaEnabledKey)
|
|
33
33
|
resolve(nil)
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -41,12 +41,12 @@ final class BundleDropModule: NSObject {
|
|
|
41
41
|
return
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
guard let url =
|
|
44
|
+
guard let url = BundleDropLocatorCore.bundleURL() else {
|
|
45
45
|
print("⚠️ No downloaded bundle found; skipping restart.")
|
|
46
46
|
return
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
let size =
|
|
49
|
+
let size = BundleDropLocatorCore.fileSize(at: url)
|
|
50
50
|
if size < 1024 {
|
|
51
51
|
print("⚠️ Bundle exists but looks invalid (size=\(size)). Skipping restart.")
|
|
52
52
|
return
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gfean/react-native-bundle-drop",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"nativeVersion": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
|
+
"nativeVersion": "0.3.8",
|
|
5
5
|
"description": "Over-the-air (OTA) updates for React Native — ship fixes instantly, no App Store or Play Store delays",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|