scandit-react-native-datacapture-core 8.4.0 → 8.4.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.
@@ -6,19 +6,27 @@
6
6
 
7
7
  import Foundation
8
8
 
9
+ // Keep importing React_RCTAppDelegate when reachable: it makes the Swift-visible
10
+ // RCTReactNativeFactory type identity match what a consumer AppDelegate sees, so
11
+ // its conformance to this protocol resolves on RN >= 0.78 (SDC-32584).
9
12
  #if canImport(React_RCTAppDelegate)
10
13
  import React_RCTAppDelegate
11
14
  #endif
12
15
 
16
+ // Gate the RN 0.78+ requirement on RCT_REACT_NATIVE_FACTORY_AVAILABLE (set by the
17
+ // podspec when RN >= 0.78), NOT canImport(React_RCTAppDelegate): that module has
18
+ // existed since RN ~0.71, so canImport is true on RN < 0.78 where RCTReactNativeFactory
19
+ // does not yet exist — which is what broke the build there (SDC-32584).
20
+
13
21
  /// Protocol for AppDelegates that expose a React Native factory (RN 0.78+).
14
22
  /// Implement this protocol to let the Scandit SDK access your RCTReactNativeFactory
15
23
  /// for creating native views from JS components.
16
24
  @objc public protocol ScanditReactNativeFactoryContainer {
17
- #if canImport(React_RCTAppDelegate)
25
+ #if RCT_REACT_NATIVE_FACTORY_AVAILABLE
18
26
  @objc var reactNativeFactory: RCTReactNativeFactory? { get }
19
27
  #else
20
- // Fallback when the React_RCTAppDelegate Swift module isn't reachable
21
- // (Expo + static frameworks). SDC-30774.
28
+ // Fallback when RCTReactNativeFactory isn't available (RN < 0.78, or the
29
+ // React_RCTAppDelegate module isn't reachable — Expo + static frameworks). SDC-30774.
22
30
  @objc var reactNativeFactory: NSObject? { get }
23
31
  #endif
24
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scandit-react-native-datacapture-core",
3
- "version": "8.4.0",
3
+ "version": "8.4.2",
4
4
  "description": "Scandit Data Capture SDK for React Native",
5
5
  "homepage": "https://github.com/Scandit/scandit-react-native-datacapture-core",
6
6
  "main": "dist/index.js",
@@ -84,6 +84,6 @@
84
84
  }
85
85
  },
86
86
  "dependencies": {
87
- "scandit-datacapture-frameworks-core": "8.4.0"
87
+ "scandit-datacapture-frameworks-core": "8.4.2"
88
88
  }
89
89
  }
@@ -52,7 +52,9 @@ Pod::Spec.new do |s|
52
52
  s.source_files = "ios/Sources/**/*.{h,m,mm,swift}", "ios/generated/**/*.{h,m,mm,cpp}"
53
53
  s.private_header_files = "ios/generated/**/*.h"
54
54
  s.exclude_files = "ios/Sources/OldArch/**/*"
55
- s.dependency "React-RCTAppDelegate"
55
+ # RCTReactNativeFactory (the only consumer) exists only on RN >= 0.78; on older
56
+ # RN this pod is absent and the code uses the NSObject fallback. SDC-32584.
57
+ s.dependency "React-RCTAppDelegate" if is_factory_available
56
58
 
57
59
  swift_flags = ['-DRCT_NEW_ARCH_ENABLED']
58
60
  if is_factory_available
@@ -66,7 +68,8 @@ Pod::Spec.new do |s|
66
68
  else
67
69
  s.source_files = "ios/Sources/**/*.{h,m,mm,swift}"
68
70
  s.exclude_files = "ios/Sources/NewArch/**/*"
69
- s.dependency "React-RCTAppDelegate"
71
+ # See note above: gate the dependency on RN >= 0.78. SDC-32584.
72
+ s.dependency "React-RCTAppDelegate" if is_factory_available
70
73
 
71
74
  swift_flags = []
72
75
  if is_factory_available
@@ -80,7 +83,7 @@ Pod::Spec.new do |s|
80
83
  end
81
84
  end
82
85
 
83
- s.dependency "scandit-datacapture-frameworks-core", '= 8.4.0'
86
+ s.dependency "scandit-datacapture-frameworks-core", '= 8.4.2'
84
87
 
85
88
  if respond_to?(:install_modules_dependencies, true)
86
89
  install_modules_dependencies(s)