expo-updates-interface 0.5.1 → 0.7.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/CHANGELOG.md +17 -1
- package/android/build.gradle +27 -8
- package/android/src/main/java/expo/modules/updatesinterface/UpdatesInterface.java +9 -0
- package/ios/EXUpdatesInterface/EXUpdatesControllerRegistry.h +16 -0
- package/ios/EXUpdatesInterface/EXUpdatesControllerRegistry.m +19 -0
- package/ios/EXUpdatesInterface/EXUpdatesExternalInterface.h +11 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 0.
|
|
13
|
+
## 0.7.0 — 2022-07-07
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- [Android] Get downloaded update IDs. ([#17933](https://github.com/expo/expo/pull/17933) by [@douglowder](https://github.com/douglowder))
|
|
18
|
+
|
|
19
|
+
## 0.6.0 — 2022-04-18
|
|
20
|
+
|
|
21
|
+
### 🎉 New features
|
|
22
|
+
|
|
23
|
+
- Add controller registry in order to support dev client auto-setup with updates integration on iOS. ([#16230](https://github.com/expo/expo/pull/16230) by [@esamelson](https://github.com/esamelson))
|
|
24
|
+
|
|
25
|
+
### ⚠️ Notices
|
|
26
|
+
|
|
27
|
+
- On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
|
|
28
|
+
|
|
29
|
+
## 0.5.1 - 2022-02-01
|
|
14
30
|
|
|
15
31
|
### 🐛 Bug fixes
|
|
16
32
|
|
package/android/build.gradle
CHANGED
|
@@ -4,20 +4,35 @@ apply plugin: 'kotlin-android-extensions'
|
|
|
4
4
|
apply plugin: 'maven-publish'
|
|
5
5
|
|
|
6
6
|
group = 'host.exp.exponent'
|
|
7
|
-
version = '0.
|
|
7
|
+
version = '0.7.0'
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
10
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
11
|
+
if (expoModulesCorePlugin.exists()) {
|
|
12
|
+
apply from: expoModulesCorePlugin
|
|
13
|
+
applyKotlinExpoModulesCorePlugin()
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
11
17
|
ext.safeExtGet = { prop, fallback ->
|
|
12
18
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
13
19
|
}
|
|
14
20
|
|
|
21
|
+
// Ensures backward compatibility
|
|
22
|
+
ext.getKotlinVersion = {
|
|
23
|
+
if (ext.has("kotlinVersion")) {
|
|
24
|
+
ext.kotlinVersion()
|
|
25
|
+
} else {
|
|
26
|
+
ext.safeExtGet("kotlinVersion", "1.6.10")
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
15
30
|
repositories {
|
|
16
31
|
mavenCentral()
|
|
17
32
|
}
|
|
18
33
|
|
|
19
34
|
dependencies {
|
|
20
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${
|
|
35
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
21
36
|
}
|
|
22
37
|
}
|
|
23
38
|
|
|
@@ -45,18 +60,22 @@ afterEvaluate {
|
|
|
45
60
|
}
|
|
46
61
|
|
|
47
62
|
android {
|
|
48
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
63
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
49
64
|
|
|
50
65
|
compileOptions {
|
|
51
|
-
sourceCompatibility JavaVersion.
|
|
52
|
-
targetCompatibility JavaVersion.
|
|
66
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
67
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
kotlinOptions {
|
|
71
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
53
72
|
}
|
|
54
73
|
|
|
55
74
|
defaultConfig {
|
|
56
75
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
57
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
76
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
58
77
|
versionCode 1
|
|
59
|
-
versionName '0.
|
|
78
|
+
versionName '0.7.0'
|
|
60
79
|
}
|
|
61
80
|
lintOptions {
|
|
62
81
|
abortOnError false
|
|
@@ -68,5 +87,5 @@ repositories {
|
|
|
68
87
|
}
|
|
69
88
|
|
|
70
89
|
dependencies {
|
|
71
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
90
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
72
91
|
}
|
|
@@ -5,6 +5,8 @@ import android.content.Context;
|
|
|
5
5
|
import org.json.JSONObject;
|
|
6
6
|
|
|
7
7
|
import java.util.HashMap;
|
|
8
|
+
import java.util.List;
|
|
9
|
+
import java.util.UUID;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Interface for modules that depend on expo-updates for loading production updates but do not want
|
|
@@ -25,6 +27,11 @@ public interface UpdatesInterface {
|
|
|
25
27
|
boolean onManifestLoaded(JSONObject manifest);
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
interface QueryCallback {
|
|
31
|
+
void onFailure(Exception e);
|
|
32
|
+
void onSuccess(List<UUID> updateIds);
|
|
33
|
+
}
|
|
34
|
+
|
|
28
35
|
interface Update {
|
|
29
36
|
JSONObject getManifest();
|
|
30
37
|
String getLaunchAssetPath();
|
|
@@ -33,4 +40,6 @@ public interface UpdatesInterface {
|
|
|
33
40
|
void reset();
|
|
34
41
|
|
|
35
42
|
void fetchUpdateWithConfiguration(HashMap<String, Object> configuration, Context context, UpdateCallback callback);
|
|
43
|
+
|
|
44
|
+
void storedUpdateIdsWithConfiguration(HashMap<String, Object> configuration, Context context, QueryCallback callback);
|
|
36
45
|
}
|
|
@@ -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
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
NS_ASSUME_NONNULL_BEGIN
|
|
6
6
|
|
|
7
7
|
typedef void (^EXUpdatesErrorBlock) (NSError *error);
|
|
8
|
-
typedef void (^
|
|
8
|
+
typedef void (^EXUpdatesUpdateSuccessBlock) (NSDictionary * _Nullable manifest);
|
|
9
|
+
typedef void (^EXUpdatesQuerySuccessBlock) (NSArray<NSUUID *> * _Nonnull updateIds);
|
|
9
10
|
typedef void (^EXUpdatesProgressBlock) (NSUInteger successfulAssetCount, NSUInteger failedAssetCount, NSUInteger totalAssetCount);
|
|
10
11
|
/**
|
|
11
12
|
* Called when a manifest has been downloaded. The return value indicates whether or not to
|
|
@@ -29,9 +30,17 @@ typedef BOOL (^EXUpdatesManifestBlock) (NSDictionary *manifest);
|
|
|
29
30
|
- (void)fetchUpdateWithConfiguration:(NSDictionary *)configuration
|
|
30
31
|
onManifest:(EXUpdatesManifestBlock)manifestBlock
|
|
31
32
|
progress:(EXUpdatesProgressBlock)progressBlock
|
|
32
|
-
success:(
|
|
33
|
+
success:(EXUpdatesUpdateSuccessBlock)successBlock
|
|
33
34
|
error:(EXUpdatesErrorBlock)errorBlock;
|
|
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
|
+
- (void)storedUpdateIdsWithConfiguration:(NSDictionary *)configuration
|
|
41
|
+
success:(EXUpdatesQuerySuccessBlock)successBlock
|
|
42
|
+
error:(EXUpdatesErrorBlock)errorBlock;
|
|
43
|
+
|
|
35
44
|
@end
|
|
36
45
|
|
|
37
46
|
NS_ASSUME_NONNULL_END
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-updates-interface",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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": "6e131f2da851a47c3a24eb3d6fc971a1a7822086"
|
|
27
27
|
}
|