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 CHANGED
@@ -1,9 +1,23 @@
1
1
  # react-native-ota-client
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/react-native-ota-client.svg)](https://www.npmjs.com/package/react-native-ota-client)
4
+ [![Documentation](https://img.shields.io/badge/docs-docs.ota.arjunis.me-blue)](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)` — configure the manager once before use.
132
- - `beginProcess()` — select/rollback the startup bundle before React Native starts.
133
- - `bundlePathForReactHost()` — return the selected bundle path, or `null` for the APK bundle.
134
- - `status()`, `checkForUpdate()`, `markHealthy()`, and `closeAppForUpdate(activity)` — operations used by the TurboModule implementation.
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
  }
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export { multiply } from './multiply';
4
3
  export { default as OTAUpdates } from "./NativeOTAUpdates.js";
5
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["multiply","default","OTAUpdates"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,OAAO,IAAIC,UAAU,QAAQ,uBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["default","OTAUpdates"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,uBAAoB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- export { multiply } from './multiply';
2
1
  export { default as OTAUpdates } from './NativeOTAUpdates.js';
3
2
  export type { OtaUpdateStatus, Spec as OtaUpdatesSpec, } from './NativeOTAUpdates.js';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAoB,CAAC;AAC3D,YAAY,EACV,eAAe,EACf,IAAI,IAAI,cAAc,GACvB,MAAM,uBAAoB,CAAC"}
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.0",
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://github.com/arjunnarangali/react-native-ota-client#readme",
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,4 +1,3 @@
1
- export { multiply } from './multiply';
2
1
  export { default as OTAUpdates } from './NativeOTAUpdates';
3
2
  export type {
4
3
  OtaUpdateStatus,
@@ -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
@@ -1,5 +0,0 @@
1
- #import <OtaSdkSpec/OtaSdkSpec.h>
2
-
3
- @interface OtaSdk : NSObject <NativeOtaSdkSpec>
4
-
5
- @end
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,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('OtaSdk');
5
- //# sourceMappingURL=NativeOtaSdk.js.map
@@ -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":[]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- export function multiply(a, b) {
4
- return a * b;
5
- }
6
- //# sourceMappingURL=multiply.js.map
@@ -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,7 +0,0 @@
1
- "use strict";
2
-
3
- import OtaSdk from "./NativeOtaSdk.js";
4
- export function multiply(a, b) {
5
- return OtaSdk.multiply(a, b);
6
- }
7
- //# sourceMappingURL=multiply.native.js.map
@@ -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,7 +0,0 @@
1
- import { type TurboModule } from 'react-native';
2
- export interface Spec extends TurboModule {
3
- multiply(a: number, b: number): number;
4
- }
5
- declare const _default: Spec;
6
- export default _default;
7
- //# sourceMappingURL=NativeOtaSdk.d.ts.map
@@ -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,2 +0,0 @@
1
- export declare function multiply(a: number, b: number): number;
2
- //# sourceMappingURL=multiply.d.ts.map
@@ -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,2 +0,0 @@
1
- export declare function multiply(a: number, b: number): number;
2
- //# sourceMappingURL=multiply.native.d.ts.map
@@ -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"}
@@ -1,7 +0,0 @@
1
- import { TurboModuleRegistry, type TurboModule } from 'react-native';
2
-
3
- export interface Spec extends TurboModule {
4
- multiply(a: number, b: number): number;
5
- }
6
-
7
- export default TurboModuleRegistry.getEnforcing<Spec>('OtaSdk');
@@ -1,5 +0,0 @@
1
- import OtaSdk from './NativeOtaSdk';
2
-
3
- export function multiply(a: number, b: number): number {
4
- return OtaSdk.multiply(a, b);
5
- }
package/src/multiply.tsx DELETED
@@ -1,3 +0,0 @@
1
- export function multiply(a: number, b: number): number {
2
- return a * b;
3
- }