react-native-sinch-calling 0.6.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## Unreleased
6
+
7
+ ### Fixed
8
+
9
+ - Making `SinchCalling.h` public (0.6.1) fixed the missing-symbol error but broke the build a different way: that header pulls in the Codegen-generated `SinchCallingSpec.h`, which requires Objective-C++ — fine for the `.mm` files that already imported it internally, but Clang errors (`Could not build Objective-C module 'SinchCalling'`, `'utility' file not found`, `This file must be compiled as Obj-C++`) trying to build it as this pod's *public* Swift-facing module interface. Moved the one thing that actually needs to be public — `eagerlyRegisterForVoipPush` — onto a new, separate `SinchCallingBootstrap` class with its own header that has no dependency on `SinchCallingSpec.h` at all. `SinchCalling.h` goes back to private.
10
+
11
+ ### Changed
12
+
13
+ - **Breaking (native-only, not exposed to JS):** call `SinchCallingBootstrap.eagerlyRegisterForVoipPush()` instead of `SinchCalling.eagerlyRegisterForVoipPush()` from `AppDelegate`.
14
+
15
+ ## 0.6.1
16
+
17
+ ### Fixed
18
+
19
+ - `SinchCalling.eagerlyRegisterForVoipPush()` (added in 0.6.0) was unreachable from a consumer app's Swift code (`Module 'SinchCalling' has no member named 'eagerlyRegisterForVoipPush'`) — the podspec marked its only header (`SinchCalling.h`) as private, which hid it from anything outside this pod's own target. The RN TurboModule bridge never needed it public (it dispatches via the ObjC runtime), but a plain `import SinchCalling` from an app's `AppDelegate` does.
20
+
5
21
  ## 0.6.0
6
22
 
7
23
  ### Added
package/README.md CHANGED
@@ -50,7 +50,7 @@ npm install react-native-sinch-calling
50
50
  </array>
51
51
  ```
52
52
  - Enable the **Push Notifications** capability in Xcode (adds `aps-environment` to your entitlements) — required for `enablePushNotifications()`.
53
- - **Strongly recommended**: call `+[SinchCalling eagerlyRegisterForVoipPush]` as the first line of `application(_:didFinishLaunchingWithOptions:)` in your `AppDelegate` (native, not exposed to JS — see [Registering for VoIP push before React Native boots](#registering-for-voip-push-before-react-native-boots)). Registering only from JS via `enablePushNotifications()` means a killed app has no `PKPushRegistry` set up yet at the moment iOS relaunches it to deliver a VoIP push, so it may fail to ring.
53
+ - **Strongly recommended**: call `+[SinchCallingBootstrap eagerlyRegisterForVoipPush]` as the first line of `application(_:didFinishLaunchingWithOptions:)` in your `AppDelegate` (native, not exposed to JS — see [Registering for VoIP push before React Native boots](#registering-for-voip-push-before-react-native-boots)). Registering only from JS via `enablePushNotifications()` means a killed app has no `PKPushRegistry` set up yet at the moment iOS relaunches it to deliver a VoIP push, so it may fail to ring.
54
54
 
55
55
  ### Android
56
56
 
@@ -135,7 +135,7 @@ func application(
135
135
  _ application: UIApplication,
136
136
  didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
137
137
  ) -> Bool {
138
- SinchCalling.eagerlyRegisterForVoipPush()
138
+ SinchCallingBootstrap.eagerlyRegisterForVoipPush()
139
139
 
140
140
  // ... start React Native as usual
141
141
  return true
@@ -15,7 +15,13 @@ Pod::Spec.new do |s|
15
15
 
16
16
  s.swift_version = "5.0"
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
18
- s.private_header_files = "ios/**/*.h"
18
+ # `SinchCalling.h` imports the Codegen-generated `SinchCallingSpec.h`,
19
+ # which requires Objective-C++ — fine for `.mm` files that `#import` it
20
+ # directly, but it breaks Clang's build of this pod's *public* Swift-facing
21
+ # module interface if included there. Keep it private; `SinchCallingBootstrap.h`
22
+ # (no such dependency) is the only header a consumer app should import
23
+ # directly, e.g. from AppDelegate — see its own doc comment.
24
+ s.private_header_files = "ios/SinchCalling.h"
19
25
 
20
26
  s.dependency "SinchRTC"
21
27
 
@@ -0,0 +1,28 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ NS_ASSUME_NONNULL_BEGIN
4
+
5
+ /**
6
+ * Deliberately kept free of any dependency on the Codegen-generated
7
+ * `SinchCallingSpec.h` (which `SinchCalling.h` imports and which requires
8
+ * Objective-C++) — this class exists specifically so it can be a public,
9
+ * plain-Objective-C entry point that a consumer app's `AppDelegate.swift`
10
+ * can `import SinchCalling` and call directly, before React Native boots.
11
+ */
12
+ @interface SinchCallingBootstrap : NSObject
13
+
14
+ /**
15
+ * Registers for VoIP push (PKPushRegistry) and configures the custom
16
+ * incoming/cancel-call push field names immediately, independent of React
17
+ * Native and any consumer-app login state. Call this as early as possible —
18
+ * ideally the first line of `application(_:didFinishLaunchingWithOptions:)`
19
+ * — so a killed app can still ring and report to CallKit from a cold launch
20
+ * triggered by the push itself, before the JS bridge exists. Safe to call
21
+ * even though the RN-driven `SinchCalling` TurboModule instance is created
22
+ * later in the same process — both share the same underlying managers.
23
+ */
24
+ + (void)eagerlyRegisterForVoipPush;
25
+
26
+ @end
27
+
28
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,11 @@
1
+ #import "SinchCallingBootstrap.h"
2
+ #import "SinchCalling.h"
3
+
4
+ @implementation SinchCallingBootstrap
5
+
6
+ + (void)eagerlyRegisterForVoipPush
7
+ {
8
+ [SinchCalling eagerlyRegisterForVoipPush];
9
+ }
10
+
11
+ @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-sinch-calling",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "React Native TurboModule wrapper for Sinch Voice Calling SDK (Android & iOS)",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",