@fishjam-cloud/ios-expo-voip 0.29.0

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 ADDED
@@ -0,0 +1,61 @@
1
+ # @fishjam-cloud/ios-expo-voip
2
+
3
+ iOS AppDelegate glue for [Fishjam](https://fishjam.io) VoIP. Install it alongside
4
+ `@fishjam-cloud/react-native-client` when you enable VoIP options in the Fishjam config plugin.
5
+
6
+ It contains no JavaScript and no VoIP logic of its own — just an
7
+ [`ExpoAppDelegateSubscriber`](https://docs.expo.dev/modules/appdelegate-subscribers/) that forwards
8
+ two AppDelegate events into the Fishjam SDK:
9
+
10
+ - `didFinishLaunchingWithOptions` → starts the PushKit registry at launch, so VoIP pushes delivered
11
+ before the JS bundle loads (cold start) can still report an incoming call
12
+ - `application(_:continue:restorationHandler:)` → routes Siri and Phone-app Recents call intents
13
+ (`INStartCallIntent`) into the SDK
14
+
15
+ ## Installation
16
+
17
+ ```sh
18
+ npx expo install @fishjam-cloud/ios-expo-voip
19
+ ```
20
+
21
+ That's it — Expo autolinking picks the module up during `pod install`. The subscriber only
22
+ activates when the `FishjamVoIPEnabled` Info.plist flag is present, which the
23
+ `@fishjam-cloud/react-native-client` config plugin writes automatically when `voip` options are
24
+ set. Apps that install this package without enabling VoIP get a no-op.
25
+
26
+ ### Also required: the `aps-environment` entitlement
27
+
28
+ This package arms `PKPushRegistry` at launch, but iOS only issues a VoIP token to an app that
29
+ declares the push entitlement. Without it registration silently never completes — no token, no
30
+ incoming calls — even though this subscriber ran correctly. Add it in `app.json`:
31
+
32
+ ```json
33
+ {
34
+ "expo": {
35
+ "ios": {
36
+ "entitlements": { "aps-environment": "development" }
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ Use `"production"` for TestFlight / App Store builds, and make sure Push Notifications is
43
+ enabled for your App ID in the Apple Developer portal. VoIP pushes are never delivered to the
44
+ iOS Simulator; test on a real device.
45
+
46
+ ## Bare React Native (no Expo Modules)
47
+
48
+ If your app does not use `ExpoAppDelegate`, wire the two calls manually in your `AppDelegate`:
49
+
50
+ ```swift
51
+ // in application(_:didFinishLaunchingWithOptions:)
52
+ VoIPManager.registerForVoIPPushes()
53
+
54
+ // in application(_:continue:restorationHandler:)
55
+ if VoIPManager.handleContinueUserActivity(userActivity) {
56
+ return true
57
+ }
58
+ ```
59
+
60
+ Android needs no equivalent — everything is handled declaratively via the manifest by the config
61
+ plugin.
@@ -0,0 +1,6 @@
1
+ {
2
+ "platforms": ["apple"],
3
+ "apple": {
4
+ "appDelegateSubscribers": ["VoIPAppDelegateSubscriber"]
5
+ }
6
+ }
@@ -0,0 +1,20 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'FishjamExpoVoip'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.author = { 'Fishjam Cloud' => 'https://github.com/fishjam-cloud' }
11
+ s.homepage = package['homepage']
12
+ s.source = { :git => 'https://github.com/fishjam-cloud/web-client-sdk.git', :tag => s.version.to_s }
13
+ s.platforms = { :ios => '15.1' }
14
+ s.swift_version = '5.0'
15
+
16
+ s.dependency 'ExpoModulesCore'
17
+ s.dependency 'FishjamReactNativeWebrtc'
18
+
19
+ s.source_files = '**/*.swift'
20
+ end
@@ -0,0 +1,38 @@
1
+ import ExpoModulesCore
2
+ import FishjamReactNativeWebrtc
3
+ import UIKit
4
+
5
+ /// Forwards the two AppDelegate events Fishjam VoIP needs into the SDK:
6
+ /// - app launch -> start the PushKit registry (required before JS loads so
7
+ /// cold-start VoIP pushes can report an incoming call)
8
+ /// - Phone-app Recents call intents -> `VoIPManager`
9
+ ///
10
+ /// Gated by the `FishjamVoIPEnabled` Info.plist flag, which the
11
+ /// `@fishjam-cloud/react-native-client` config plugin writes when VoIP
12
+ /// options are enabled, without it this subscriber does nothing.
13
+ public class VoIPAppDelegateSubscriber: ExpoAppDelegateSubscriber {
14
+ private var voipEnabled: Bool {
15
+ Bundle.main.object(forInfoDictionaryKey: "FishjamVoIPEnabled") as? Bool ?? false
16
+ }
17
+
18
+ public func application(
19
+ _ application: UIApplication,
20
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
21
+ ) -> Bool {
22
+ if voipEnabled {
23
+ VoIPManager.registerForVoIPPushes()
24
+ }
25
+ return true
26
+ }
27
+
28
+ public func application(
29
+ _ application: UIApplication,
30
+ continue userActivity: NSUserActivity,
31
+ restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
32
+ ) -> Bool {
33
+ guard voipEnabled, userActivity.activityType.hasPrefix("INStart") else {
34
+ return false
35
+ }
36
+ return VoIPManager.handleContinueUserActivity(userActivity)
37
+ }
38
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@fishjam-cloud/ios-expo-voip",
3
+ "version": "0.29.0",
4
+ "description": "AppDelegate glue for Fishjam VoIP on iOS — registers PushKit at launch and routes Siri/Recents call intents. Install alongside @fishjam-cloud/react-native-client when VoIP options are enabled.",
5
+ "license": "Apache-2.0",
6
+ "author": "Fishjam Team",
7
+ "files": [
8
+ "ios/**",
9
+ "expo-module.config.json",
10
+ "README.md"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/fishjam-cloud/web-client-sdk.git",
15
+ "directory": "packages/ios-expo-voip"
16
+ },
17
+ "homepage": "https://github.com/fishjam-cloud/web-client-sdk#readme",
18
+ "bugs": "https://github.com/fishjam-cloud/web-client-sdk/issues",
19
+ "keywords": [
20
+ "voip",
21
+ "callkit",
22
+ "pushkit",
23
+ "expo",
24
+ "fishjam"
25
+ ],
26
+ "scripts": {
27
+ "format": "prettier --write .",
28
+ "format:check": "prettier --check .",
29
+ "check:webrtc-published": "node ../../release-automation/check-webrtc-published.mjs"
30
+ },
31
+ "peerDependencies": {
32
+ "@fishjam-cloud/react-native-webrtc": "0.29.0",
33
+ "expo": "*"
34
+ },
35
+ "packageManager": "yarn@4.16.0"
36
+ }