react-native-sinch-calling 0.6.1 → 0.6.3
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,7 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
-
##
|
|
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
|
|
6
16
|
|
|
7
17
|
### Fixed
|
|
8
18
|
|
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 `+[
|
|
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
|
-
|
|
138
|
+
SinchCallingBootstrap.eagerlyRegisterForVoipPush()
|
|
139
139
|
|
|
140
140
|
// ... start React Native as usual
|
|
141
141
|
return true
|
package/SinchCalling.podspec
CHANGED
|
@@ -15,11 +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
|
-
# `SinchCalling.h`
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
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"
|
|
23
25
|
|
|
24
26
|
s.dependency "SinchRTC"
|
|
25
27
|
|
|
@@ -197,12 +197,14 @@ class SinchCallManager(private val context: Context) {
|
|
|
197
197
|
return
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
sinchClient.audioController.enableAutomaticAudioRouting(
|
|
201
|
-
AudioController.AudioRoutingConfig(AudioController.UseSpeakerphone.SPEAKERPHONE_AUTO, true)
|
|
202
|
-
)
|
|
203
|
-
|
|
204
200
|
sinchClient.addSinchClientListener(object : SinchClientListener {
|
|
205
201
|
override fun onClientStarted(client: SinchClient) {
|
|
202
|
+
// `audioController` throws `IllegalStateException: SinchClient not
|
|
203
|
+
// started` if touched before this callback — it's only valid once
|
|
204
|
+
// the client has actually started, not right after `build()`.
|
|
205
|
+
client.audioController.enableAutomaticAudioRouting(
|
|
206
|
+
AudioController.AudioRoutingConfig(AudioController.UseSpeakerphone.SPEAKERPHONE_AUTO, true)
|
|
207
|
+
)
|
|
206
208
|
listener?.onClientStarted()
|
|
207
209
|
}
|
|
208
210
|
|
|
@@ -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
|
package/package.json
CHANGED