react-native-ota-client 0.3.1 → 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
@@ -15,7 +15,8 @@ Full setup and API guides are at [docs.ota.arjunis.me](https://docs.ota.arjunis.
15
15
  - [JavaScript API](https://docs.ota.arjunis.me/guide/javascript-api)
16
16
  - [Android setup](https://docs.ota.arjunis.me/guide/android)
17
17
  - [iOS setup](https://docs.ota.arjunis.me/guide/ios)
18
- - [Server contract](https://docs.ota.arjunis.me/server)
18
+ - [Server guide](https://docs.ota.arjunis.me/server/)
19
+ - [Server API and client contract](https://docs.ota.arjunis.me/server/api#client-contract)
19
20
 
20
21
  ## Requirements and support
21
22
 
@@ -50,8 +51,6 @@ await OTAUpdates.closeAppToApplyUpdate();
50
51
 
51
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.
52
53
 
53
- The package also retains the generated-template `multiply()` example; it is not part of the OTA API.
54
-
55
54
  ## Android configuration
56
55
 
57
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.
@@ -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.1",
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",
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
- }