expo-updates-interface 0.9.2 → 0.9.3
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/CHANGELOG.md +2 -4
- package/android/build.gradle +2 -2
- package/ios/EXUpdatesInterface/EXUpdatesControllerRegistry.h +16 -0
- package/ios/EXUpdatesInterface/EXUpdatesControllerRegistry.m +19 -0
- package/ios/EXUpdatesInterface/EXUpdatesExternalInterface.h +46 -0
- package/ios/EXUpdatesInterface.podspec +3 -12
- package/package.json +2 -2
- package/ios/EXUpdatesInterface/UpdatesControllerRegistry.swift +0 -11
- package/ios/EXUpdatesInterface/UpdatesExternalInterface.swift +0 -45
package/CHANGELOG.md
CHANGED
|
@@ -10,11 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 0.9.
|
|
13
|
+
## 0.9.3 — 2023-05-11
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- iOS: convert to swift. ([#21646](https://github.com/expo/expo/pull/21646) by [@wschurman](https://github.com/wschurman))
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
18
16
|
|
|
19
17
|
## 0.9.1 — 2023-02-09
|
|
20
18
|
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.9.
|
|
6
|
+
version = '0.9.3'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -74,7 +74,7 @@ android {
|
|
|
74
74
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
75
75
|
targetSdkVersion safeExtGet("targetSdkVersion", 33)
|
|
76
76
|
versionCode 1
|
|
77
|
-
versionName '0.9.
|
|
77
|
+
versionName '0.9.3'
|
|
78
78
|
}
|
|
79
79
|
lintOptions {
|
|
80
80
|
abortOnError false
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright © 2022-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
#import <EXUpdatesInterface/EXUpdatesExternalInterface.h>
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Simple singleton registry that holds a reference to a single controller implementing
|
|
7
|
+
* EXUpdatesExternalInterface. This allows modules (like expo-dev-launcher) to acccess such a
|
|
8
|
+
* controller without their podspec needing to declare a dependency on expo-updates.
|
|
9
|
+
*/
|
|
10
|
+
@interface EXUpdatesControllerRegistry : NSObject
|
|
11
|
+
|
|
12
|
+
@property (nonatomic, weak) id<EXUpdatesExternalInterface> controller;
|
|
13
|
+
|
|
14
|
+
+ (instancetype)sharedInstance;
|
|
15
|
+
|
|
16
|
+
@end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright © 2022-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
#import <EXUpdatesInterface/EXUpdatesControllerRegistry.h>
|
|
4
|
+
|
|
5
|
+
@implementation EXUpdatesControllerRegistry
|
|
6
|
+
|
|
7
|
+
+ (instancetype)sharedInstance
|
|
8
|
+
{
|
|
9
|
+
static EXUpdatesControllerRegistry *theRegistry;
|
|
10
|
+
static dispatch_once_t once;
|
|
11
|
+
dispatch_once(&once, ^{
|
|
12
|
+
if (!theRegistry) {
|
|
13
|
+
theRegistry = [[EXUpdatesControllerRegistry alloc] init];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return theRegistry;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright © 2021 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
#import <Foundation/Foundation.h>
|
|
4
|
+
|
|
5
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
6
|
+
|
|
7
|
+
typedef void (^EXUpdatesErrorBlock) (NSError *error);
|
|
8
|
+
typedef void (^EXUpdatesUpdateSuccessBlock) (NSDictionary * _Nullable manifest);
|
|
9
|
+
typedef void (^EXUpdatesQuerySuccessBlock) (NSArray<NSUUID *> * _Nonnull updateIds);
|
|
10
|
+
typedef void (^EXUpdatesProgressBlock) (NSUInteger successfulAssetCount, NSUInteger failedAssetCount, NSUInteger totalAssetCount);
|
|
11
|
+
/**
|
|
12
|
+
* Called when a manifest has been downloaded. The return value indicates whether or not to
|
|
13
|
+
* continue downloading the update described by this manifest. Returning `NO` will abort the
|
|
14
|
+
* load, and the success block will be immediately called with a nil `manifest`.
|
|
15
|
+
*/
|
|
16
|
+
typedef BOOL (^EXUpdatesManifestBlock) (NSDictionary *manifest);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Protocol for modules that depend on expo-updates for loading production updates but do not want
|
|
20
|
+
* to depend on expo-updates or delegate control to the singleton EXUpdatesAppController.
|
|
21
|
+
*/
|
|
22
|
+
@protocol EXUpdatesExternalInterface
|
|
23
|
+
|
|
24
|
+
@property (nonatomic, weak) id bridge;
|
|
25
|
+
|
|
26
|
+
- (NSURL *)launchAssetURL;
|
|
27
|
+
|
|
28
|
+
- (void)reset;
|
|
29
|
+
|
|
30
|
+
- (void)fetchUpdateWithConfiguration:(NSDictionary *)configuration
|
|
31
|
+
onManifest:(EXUpdatesManifestBlock)manifestBlock
|
|
32
|
+
progress:(EXUpdatesProgressBlock)progressBlock
|
|
33
|
+
success:(EXUpdatesUpdateSuccessBlock)successBlock
|
|
34
|
+
error:(EXUpdatesErrorBlock)errorBlock;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Obtains a list of UUIDs for updates already in the updates DB that are in the READY state.
|
|
38
|
+
* The success block will pass in the array of UUIDs
|
|
39
|
+
*/
|
|
40
|
+
- (void)storedUpdateIdsWithConfiguration:(NSDictionary *)configuration
|
|
41
|
+
success:(EXUpdatesQuerySuccessBlock)successBlock
|
|
42
|
+
error:(EXUpdatesErrorBlock)errorBlock;
|
|
43
|
+
|
|
44
|
+
@end
|
|
45
|
+
|
|
46
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -11,22 +11,13 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
13
|
s.platform = :ios, '13.0'
|
|
14
|
-
s.swift_version = '5.4'
|
|
15
14
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
16
15
|
s.static_framework = true
|
|
17
|
-
s.source_files
|
|
16
|
+
s.source_files = 'EXUpdatesInterface/**/*.{h,m}'
|
|
17
|
+
s.preserve_paths = 'EXUpdatesInterface/**/*.{h,m}'
|
|
18
|
+
s.requires_arc = true
|
|
18
19
|
|
|
19
|
-
# Swift/Objective-C compatibility
|
|
20
20
|
s.pod_target_xcconfig = {
|
|
21
|
-
'GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS' => 'YES',
|
|
22
|
-
'GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS' => 'YES',
|
|
23
21
|
'DEFINES_MODULE' => 'YES',
|
|
24
|
-
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
s.script_phase = {
|
|
28
|
-
:name => 'Copy Swift Header',
|
|
29
|
-
:script => 'COMPATIBILITY_HEADER_PATH="${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h"; ditto "${COMPATIBILITY_HEADER_PATH}" "${PODS_ROOT}/Headers/Public/${PRODUCT_MODULE_NAME}/${PRODUCT_MODULE_NAME}-Swift.h"',
|
|
30
|
-
:execution_position => :after_compile
|
|
31
22
|
}
|
|
32
23
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-updates-interface",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "Native interface for modules that optionally depend on expo-updates, e.g. expo-dev-launcher.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"expo": "*"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "69f32b825787c4c99c14898a9a854db7524e82fe"
|
|
27
27
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-present 650 Industries. All rights reserved.
|
|
2
|
-
|
|
3
|
-
import Foundation
|
|
4
|
-
|
|
5
|
-
@objc(EXUpdatesControllerRegistry)
|
|
6
|
-
@objcMembers
|
|
7
|
-
public final class UpdatesControllerRegistry: NSObject {
|
|
8
|
-
public weak var controller: UpdatesExternalInterface?
|
|
9
|
-
|
|
10
|
-
public static let sharedInstance = UpdatesControllerRegistry()
|
|
11
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Copyright © 2021 650 Industries. All rights reserved.
|
|
2
|
-
|
|
3
|
-
import Foundation
|
|
4
|
-
|
|
5
|
-
public typealias UpdatesErrorBlock = (_ error: Error) -> Void
|
|
6
|
-
public typealias UpdatesUpdateSuccessBlock = (_ manifest: [String: Any]?) -> Void
|
|
7
|
-
public typealias UpdatesQuerySuccessBlock = (_ updateIds: [UUID]) -> Void
|
|
8
|
-
public typealias UpdatesProgressBlock = (_ successfulAssetCount: UInt, _ failedAssetCount: UInt, _ totalAssetCount: UInt) -> Void
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Called when a manifest has been downloaded. The return value indicates whether or not to
|
|
12
|
-
* continue downloading the update described by this manifest. Returning `NO` will abort the
|
|
13
|
-
* load, and the success block will be immediately called with a nil `manifest`.
|
|
14
|
-
*/
|
|
15
|
-
public typealias UpdatesManifestBlock = (_ manifest: [String: Any]) -> Bool
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Protocol for modules that depend on expo-updates for loading production updates but do not want
|
|
19
|
-
* to depend on expo-updates or delegate control to the singleton EXUpdatesAppController.
|
|
20
|
-
*/
|
|
21
|
-
@objc(EXUpdatesExternalInterface)
|
|
22
|
-
public protocol UpdatesExternalInterface {
|
|
23
|
-
@objc weak var bridge: AnyObject? { get set }
|
|
24
|
-
@objc var launchAssetURL: URL? { get }
|
|
25
|
-
|
|
26
|
-
@objc func reset()
|
|
27
|
-
|
|
28
|
-
@objc func fetchUpdate(
|
|
29
|
-
withConfiguration configuration: [String: Any],
|
|
30
|
-
onManifest manifestBlock: @escaping UpdatesManifestBlock,
|
|
31
|
-
progress progressBlock: @escaping UpdatesProgressBlock,
|
|
32
|
-
success successBlock: @escaping UpdatesUpdateSuccessBlock,
|
|
33
|
-
error errorBlock: @escaping UpdatesErrorBlock
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Obtains a list of UUIDs for updates already in the updates DB that are in the READY state.
|
|
38
|
-
* The success block will pass in the array of UUIDs
|
|
39
|
-
*/
|
|
40
|
-
@objc func storedUpdateIds(
|
|
41
|
-
withConfiguration configuration: [String: Any],
|
|
42
|
-
success successBlock: @escaping UpdatesQuerySuccessBlock,
|
|
43
|
-
error errorBlock: @escaping UpdatesErrorBlock
|
|
44
|
-
)
|
|
45
|
-
}
|