react-native-ota-client 0.3.0 → 0.3.2
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/README.md +18 -6
- package/android/src/main/java/com/otasdk/OtaSdkPackage.kt +0 -2
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.tsx +0 -1
- package/android/src/main/java/com/otasdk/OtaSdkModule.kt +0 -15
- package/ios/OtaSdk.h +0 -5
- package/ios/OtaSdk.mm +0 -21
- package/lib/module/NativeOtaSdk.js +0 -5
- package/lib/module/NativeOtaSdk.js.map +0 -1
- package/lib/module/multiply.js +0 -6
- package/lib/module/multiply.js.map +0 -1
- package/lib/module/multiply.native.js +0 -7
- package/lib/module/multiply.native.js.map +0 -1
- package/lib/typescript/src/NativeOtaSdk.d.ts +0 -7
- package/lib/typescript/src/NativeOtaSdk.d.ts.map +0 -1
- package/lib/typescript/src/multiply.d.ts +0 -2
- package/lib/typescript/src/multiply.d.ts.map +0 -1
- package/lib/typescript/src/multiply.native.d.ts +0 -2
- package/lib/typescript/src/multiply.native.d.ts.map +0 -1
- package/src/NativeOtaSdk.ts +0 -7
- package/src/multiply.native.tsx +0 -5
- package/src/multiply.tsx +0 -3
package/README.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
# react-native-ota-client
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/react-native-ota-client)
|
|
4
|
+
[](https://docs.ota.arjunis.me)
|
|
5
|
+
|
|
3
6
|
Android and iOS OTA update support for React Native applications using the New Architecture and Hermes. The SDK checks for signed releases, verifies the release manifest and packaged bundle, stages verified updates, selects the bundle on cold start, and rolls back a release that does not confirm healthy.
|
|
4
7
|
|
|
5
8
|
OTA can update JavaScript and bundled assets. Native code, permissions/entitlements, React Native/Hermes versions, and Codegen contract changes require a new APK/IPA.
|
|
6
9
|
|
|
10
|
+
## Documentation
|
|
11
|
+
|
|
12
|
+
Full setup and API guides are at [docs.ota.arjunis.me](https://docs.ota.arjunis.me).
|
|
13
|
+
|
|
14
|
+
- [Installation](https://docs.ota.arjunis.me/guide/installation)
|
|
15
|
+
- [JavaScript API](https://docs.ota.arjunis.me/guide/javascript-api)
|
|
16
|
+
- [Android setup](https://docs.ota.arjunis.me/guide/android)
|
|
17
|
+
- [iOS setup](https://docs.ota.arjunis.me/guide/ios)
|
|
18
|
+
- [Server guide](https://docs.ota.arjunis.me/server/)
|
|
19
|
+
- [Server API and client contract](https://docs.ota.arjunis.me/server/api#client-contract)
|
|
20
|
+
|
|
7
21
|
## Requirements and support
|
|
8
22
|
|
|
9
23
|
- Android and iOS.
|
|
@@ -37,8 +51,6 @@ await OTAUpdates.closeAppToApplyUpdate();
|
|
|
37
51
|
|
|
38
52
|
On iOS, apps cannot terminate themselves. When `closeAppToApplyUpdate()` returns `true`, ask the user to leave and reopen the app to load the staged bundle.
|
|
39
53
|
|
|
40
|
-
The package also retains the generated-template `multiply()` example; it is not part of the OTA API.
|
|
41
|
-
|
|
42
54
|
## Android configuration
|
|
43
55
|
|
|
44
56
|
Configure the SDK once in the host application's `Application` class. Initialize it in `onCreate()` before calling `loadReactNative()`, and provide the selected bundle path to React Native's host configuration. The SDK's own `BuildConfig.DEBUG` is not the consumer app's build type.
|
|
@@ -128,10 +140,10 @@ Use HTTPS for staging and production, with `allowInsecureHttp = false`. Local de
|
|
|
128
140
|
|
|
129
141
|
`OtaSdkUpdates` exposes the Android startup and host integration API:
|
|
130
142
|
|
|
131
|
-
- `initialize(context, config)`
|
|
132
|
-
- `beginProcess()`
|
|
133
|
-
- `bundlePathForReactHost()`
|
|
134
|
-
- `status()`, `checkForUpdate()`, `markHealthy()`, and `closeAppForUpdate(activity)`
|
|
143
|
+
- `initialize(context, config)` configures the manager once before use.
|
|
144
|
+
- `beginProcess()` selects or rolls back the startup bundle before React Native starts.
|
|
145
|
+
- `bundlePathForReactHost()` returns the selected bundle path, or `null` for the APK bundle.
|
|
146
|
+
- `status()`, `checkForUpdate()`, `markHealthy()`, and `closeAppForUpdate(activity)` are the operations used by the TurboModule implementation.
|
|
135
147
|
|
|
136
148
|
The SDK autolinks a single `OtaSdkPackage` containing both the sample `OtaSdk` TurboModule and the OTA `OTAUpdates` TurboModule. Do not add another manual package registration in the host app.
|
|
137
149
|
|
|
@@ -9,7 +9,6 @@ import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
|
9
9
|
class OtaSdkPackage : BaseReactPackage() {
|
|
10
10
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
11
11
|
return when (name) {
|
|
12
|
-
OtaSdkModule.NAME -> OtaSdkModule(reactContext)
|
|
13
12
|
OtaUpdatesModule.NAME -> OtaUpdatesModule(reactContext)
|
|
14
13
|
else -> null
|
|
15
14
|
}
|
|
@@ -17,7 +16,6 @@ class OtaSdkPackage : BaseReactPackage() {
|
|
|
17
16
|
|
|
18
17
|
override fun getReactModuleInfoProvider() = ReactModuleInfoProvider {
|
|
19
18
|
mapOf(
|
|
20
|
-
OtaSdkModule.NAME to moduleInfo(OtaSdkModule.NAME, OtaSdkModule::class.java.name),
|
|
21
19
|
OtaUpdatesModule.NAME to moduleInfo(OtaUpdatesModule.NAME, OtaUpdatesModule::class.java.name),
|
|
22
20
|
)
|
|
23
21
|
}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["default","OTAUpdates"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,uBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAoB,CAAC;AAC3D,YAAY,EACV,eAAe,EACf,IAAI,IAAI,cAAc,GACvB,MAAM,uBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ota-client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Android and iOS OTA updates and over-the-air JavaScript updates for React Native apps",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"bugs": {
|
|
62
62
|
"url": "https://github.com/arjunnarangali/react-native-ota-client/issues"
|
|
63
63
|
},
|
|
64
|
-
"homepage": "https://
|
|
64
|
+
"homepage": "https://docs.ota.arjunis.me/",
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"registry": "https://registry.npmjs.org/"
|
|
67
67
|
},
|
package/src/index.tsx
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
package com.otasdk
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
4
|
-
|
|
5
|
-
class OtaSdkModule(reactContext: ReactApplicationContext) :
|
|
6
|
-
NativeOtaSdkSpec(reactContext) {
|
|
7
|
-
|
|
8
|
-
override fun multiply(a: Double, b: Double): Double {
|
|
9
|
-
return a * b
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
companion object {
|
|
13
|
-
const val NAME = NativeOtaSdkSpec.NAME
|
|
14
|
-
}
|
|
15
|
-
}
|
package/ios/OtaSdk.h
DELETED
package/ios/OtaSdk.mm
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#import "OtaSdk.h"
|
|
2
|
-
|
|
3
|
-
@implementation OtaSdk
|
|
4
|
-
- (NSNumber *)multiply:(double)a b:(double)b {
|
|
5
|
-
NSNumber *result = @(a * b);
|
|
6
|
-
|
|
7
|
-
return result;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
11
|
-
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
12
|
-
{
|
|
13
|
-
return std::make_shared<facebook::react::NativeOtaSdkSpecJSI>(params);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
+ (NSString *)moduleName
|
|
17
|
-
{
|
|
18
|
-
return @"OtaSdk";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeOtaSdk.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AAMpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,QAAQ,CAAC","ignoreList":[]}
|
package/lib/module/multiply.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["multiply","a","b"],"sourceRoot":"../../src","sources":["multiply.tsx"],"mappings":";;AAAA,OAAO,SAASA,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACrD,OAAOD,CAAC,GAAGC,CAAC;AACd","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["OtaSdk","multiply","a","b"],"sourceRoot":"../../src","sources":["multiply.native.tsx"],"mappings":";;AAAA,OAAOA,MAAM,MAAM,mBAAgB;AAEnC,OAAO,SAASC,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACrD,OAAOH,MAAM,CAACC,QAAQ,CAACC,CAAC,EAAEC,CAAC,CAAC;AAC9B","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeOtaSdk.d.ts","sourceRoot":"","sources":["../../../src/NativeOtaSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxC;;AAED,wBAAgE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiply.d.ts","sourceRoot":"","sources":["../../../src/multiply.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiply.native.d.ts","sourceRoot":"","sources":["../../../src/multiply.native.tsx"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
package/src/NativeOtaSdk.ts
DELETED
package/src/multiply.native.tsx
DELETED
package/src/multiply.tsx
DELETED