react-native-ota-hot-update 2.2.6 → 2.2.8

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
@@ -69,18 +69,13 @@ Open `AppDelegate.m` and add this:
69
69
 
70
70
  From react native 0.77, AppDelegate changed to swift file, so the configuration will be change a bit.
71
71
 
72
- 1. Create a Bridging Header
73
- - Right-click on your project in the Xcode navigator and select New File from template.
74
- - Select Header File under the iOS section and click Next.
75
- - Name it something like `YourProjectName-Bridging-Header.h` and save it in your project directory.
76
- - In your project's Build Settings: Search for `Objective-C Bridging Header`.
77
- Set its value to the relative path of your bridging header file, e.g., YourProjectName/YourProjectName-Bridging-Header.h, remember need to create header file inside folder `YourProjectName`
78
- 2. Open `YourProjectName-Bridging-Header.h` and add this line:
79
-
80
- `#import "OtaHotUpdate.h"`
81
- 3. Open AppDelegate.swift:
72
+ Open AppDelegate.swift:
82
73
 
83
74
  ```bash
75
+
76
+ import react_native_ota_hot_update
77
+ ...
78
+
84
79
  override func bundleURL() -> URL? {
85
80
  #if DEBUG
86
81
  RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
@@ -116,6 +116,8 @@ dependencies {
116
116
  implementation "com.facebook.react:react-native:+"
117
117
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
118
118
  implementation 'com.jakewharton:process-phoenix:3.0.0'
119
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3"
120
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
119
121
  }
120
122
 
121
123
  if (isNewArchitectureEnabled()) {
@@ -3,7 +3,7 @@ package com.otahotupdate
3
3
  import android.content.Context
4
4
  import android.content.pm.PackageManager
5
5
  import android.os.Build
6
- import com.facebook.react.BaseReactPackage
6
+ import com.facebook.react.TurboReactPackage
7
7
  import com.facebook.react.bridge.NativeModule
8
8
  import com.facebook.react.bridge.ReactApplicationContext
9
9
  import com.facebook.react.module.model.ReactModuleInfo
@@ -15,7 +15,7 @@ import com.rnhotupdate.Common.VERSION
15
15
  import com.rnhotupdate.SharedPrefs
16
16
 
17
17
 
18
- class OtaHotUpdate : BaseReactPackage() {
18
+ class OtaHotUpdate : TurboReactPackage() {
19
19
  override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
20
20
  return if (name == OtaHotUpdateModule.NAME) {
21
21
  OtaHotUpdateModule(reactContext)
@@ -33,6 +33,7 @@ class OtaHotUpdate : BaseReactPackage() {
33
33
  OtaHotUpdateModule.NAME,
34
34
  false, // canOverrideExistingModule
35
35
  false, // needsEagerInit
36
+ true, // hasConstants
36
37
  false, // isCxxModule
37
38
  isTurboModule // isTurboModule
38
39
  )
@@ -36,7 +36,7 @@ class Utils internal constructor(private val context: Context) {
36
36
  val bundleFile = File(bundlePath)
37
37
  if (bundleFile.exists() && bundleFile.isFile) {
38
38
  val outputFolder = bundleFile.parentFile
39
- if (outputFolder != null && outputFolder.exists() && outputFolder.isDirectory && outputFolder.name.contains("output", ignoreCase = true)) {
39
+ if (outputFolder != null && outputFolder.exists() && outputFolder.isDirectory) {
40
40
  val isDeleted = deleteDirectory(outputFolder)
41
41
  sharedPrefs.putString(pathName, "")
42
42
  return isDeleted
@@ -1,13 +1,13 @@
1
1
  #import <React/RCTReloadCommand.h>
2
- #ifdef RCT_NEW_ARCH_ENABLED
3
- #import "RNOtaHotUpdateSpec.h"
4
2
 
3
+ #if defined(RCT_NEW_ARCH_ENABLED) && __has_include("RNOtaHotUpdateSpec.h")
4
+ #import "RNOtaHotUpdateSpec.h"
5
5
  @interface OtaHotUpdate : NSObject <NativeOtaHotUpdateSpec>
6
6
  #else
7
7
  #import <React/RCTBridgeModule.h>
8
-
9
8
  @interface OtaHotUpdate : NSObject <RCTBridgeModule>
10
9
  #endif
10
+
11
11
  + (NSURL *)getBundle;
12
12
 
13
13
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ota-hot-update",
3
- "version": "2.2.6",
3
+ "version": "2.2.8",
4
4
  "description": "Hot update for react native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -13,7 +13,11 @@ Pod::Spec.new do |s|
13
13
 
14
14
  s.platforms = { :ios => min_ios_version_supported }
15
15
  s.source = { :git => "https://github.com/vantuan88291/react-native-ota-hot-update.git", :tag => "#{s.version}" }
16
-
16
+ s.pod_target_xcconfig = {
17
+ 'SWIFT_VERSION' => '5.0',
18
+ 'DEFINES_MODULE' => 'YES'
19
+ }
20
+ s.public_header_files = "ios/OtaHotUpdate.h"
17
21
  s.source_files = "ios/**/*.{h,m,mm,cpp}"
18
22
  s.dependency 'SSZipArchive', '~> 2.4.3'
19
23
  if ENV['RCT_NEW_ARCH_ENABLED'] == '0'