@poolse/native 3.0.0 → 3.2.0-dev.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/CHANGELOG.md +10 -0
- package/README.md +91 -123
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Formerly `@poolse/react-native-calls` (0.x).
|
|
4
4
|
|
|
5
|
+
## 3.2.0-dev.0 — 2026-11-04 (prerelease, npm tag `dev`)
|
|
6
|
+
|
|
7
|
+
- Moves with `@poolse/sdk` 3.2.0-dev.0.
|
|
8
|
+
|
|
9
|
+
## 3.1.0 — 2026-10-27
|
|
10
|
+
|
|
11
|
+
- Declares `react` as a peer dependency (the package imports it).
|
|
12
|
+
- `expo prebuild` needs Node 20.19 or newer (the config plugin entry is
|
|
13
|
+
an ES module, loaded with `require`).
|
|
14
|
+
|
|
5
15
|
## 3.0.0 — 2026-10-26
|
|
6
16
|
|
|
7
17
|
- **Renamed** from `@poolse/react-native-calls`: import from
|
package/README.md
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@poolse/native`
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
(
|
|
5
|
-
|
|
3
|
+
The call engine for phones, for [poolse](https://poolse.dev). A native core
|
|
4
|
+
(Swift on iOS, Kotlin on Android) rings, answers and carries calls with the
|
|
5
|
+
app closed and the phone locked: CallKit and PushKit on iOS, a call service
|
|
6
|
+
and full-screen notifications on Android. You send commands; the core sends
|
|
7
|
+
back one `Snapshot` describing the call. The package also shows poolse's
|
|
8
|
+
chat notifications and gives you helpers for them.
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
comes out, and every call decision lives in the native core (behaviour
|
|
9
|
-
pinned by `contracts/call-core/vectors.json`). On a build without the
|
|
10
|
-
native module it degrades to safe no-ops with an idle state, so a host
|
|
11
|
-
can render against it unconditionally.
|
|
10
|
+
Formerly `@poolse/react-native-calls`.
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
import * as calls from '@poolse/native';
|
|
12
|
+
Full reference: <https://poolse.dev/docs/sdk/native>
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
const stop = calls.onCallState((s) => render(s)); // s: Snapshot | null
|
|
18
|
-
await calls.place(conversationId, { media: 'audio', sessionToken });
|
|
19
|
-
calls.answer();
|
|
20
|
-
calls.decline();
|
|
21
|
-
calls.hangUp();
|
|
14
|
+
## Requirements
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
- A development or release build. It is a native module, so it isn't in
|
|
17
|
+
Expo Go; without the module every command does nothing and
|
|
18
|
+
`nativeCallsAvailable` is `false`.
|
|
19
|
+
- Peers: `expo`, `expo-notifications`, `react`, `react-native`.
|
|
20
|
+
- Node 20.19 or newer for `expo prebuild`.
|
|
21
|
+
- iOS 15.1+; Android `minSdkVersion` 24.
|
|
22
|
+
- Push credentials (APNs key, FCM service account) for your workspace on the
|
|
23
|
+
poolse dashboard.
|
|
28
24
|
|
|
29
|
-
##
|
|
25
|
+
## Install and setup
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx expo install @poolse/native expo-notifications
|
|
29
|
+
```
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
generated projects. In `app.json`, after `expo-notifications`:
|
|
31
|
+
In `app.json`, after `expo-notifications`:
|
|
33
32
|
|
|
34
33
|
```json
|
|
35
34
|
"plugins": [
|
|
@@ -38,112 +37,81 @@ generated projects. In `app.json`, after `expo-notifications`:
|
|
|
38
37
|
]
|
|
39
38
|
```
|
|
40
39
|
|
|
41
|
-
| Option
|
|
42
|
-
|
|
|
43
|
-
| `ringback`
|
|
44
|
-
| `pictureInPicture` | `true`
|
|
45
|
-
| `lockscreen`
|
|
40
|
+
| Option | Default | What it does |
|
|
41
|
+
| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `ringback` | none | Ships this sound in both apps; pass its base name to `configure({ ringback })`. Lowercase letters, digits and underscores only. |
|
|
43
|
+
| `pictureInPicture` | `true` | Android: the activity may float as a picture-in-picture window. |
|
|
44
|
+
| `lockscreen` | `true` | Android: the app shows over the lock screen when opened for a call. |
|
|
46
45
|
|
|
47
|
-
Always applied
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
Always applied on Android: the LiveKit media adapter, and `expo-notifications`
|
|
47
|
+
as the receiver for pushes that aren't calls. On iOS, add `UIBackgroundModes`
|
|
48
|
+
`audio`, `voip` and `remote-notification`, `NSMicrophoneUsageDescription`
|
|
49
|
+
(and `NSCameraUsageDescription` for video) and the `aps-environment`
|
|
50
|
+
entitlement yourself. Then run `npx expo prebuild --clean`.
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Apps that copied `withNativeCallMedia`, `withCallDelegate`,
|
|
55
|
-
`withLockscreenCalls`, `withPictureInPicture` and `withRingback` into
|
|
56
|
-
their own `plugins/` folder delete them and add the single entry above;
|
|
57
|
-
the generated projects come out the same. Keep the ringback file where
|
|
58
|
-
it is and point `ringback` at it — its name is what `configure` already
|
|
59
|
-
passes. Run `npx expo prebuild --clean` once afterwards.
|
|
60
|
-
|
|
61
|
-
### Rooms — voice or video, nobody rings
|
|
62
|
-
|
|
63
|
-
A room is the conversation's drop-in call: members join when they like
|
|
64
|
-
while the chat carries on, and no phone rings. It runs on the same
|
|
65
|
-
native core as a call — CallKit on iOS, the call service on Android — so
|
|
66
|
-
it keeps going with the phone locked and routes audio like a call.
|
|
52
|
+
## Usage
|
|
67
53
|
|
|
68
54
|
```ts
|
|
69
|
-
|
|
70
|
-
await calls.startRoom(conversationId, { media: 'video', sessionToken });
|
|
71
|
-
|
|
72
|
-
// Everyone else: useLiveCall(conversationId) from @poolse/react shows it
|
|
73
|
-
// (call.kind === 'room'); LiveCallBanner's Join calls
|
|
74
|
-
await calls.join(call.id, conversationId, sessionToken);
|
|
75
|
-
|
|
76
|
-
calls.hangUp(); // leaves — the room ends once it has been empty a moment
|
|
77
|
-
```
|
|
55
|
+
import * as calls from '@poolse/native';
|
|
78
56
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
and turning the camera on (`setCamera(true)`) is all it takes to go from
|
|
84
|
-
voice to video.
|
|
57
|
+
await calls.configure('https://api.poolse.dev', {
|
|
58
|
+
ringback: 'ringback',
|
|
59
|
+
apnsEnvironment: 'production',
|
|
60
|
+
});
|
|
85
61
|
|
|
86
|
-
|
|
62
|
+
const stop = calls.onCallState((snapshot) => render(snapshot)); // Snapshot | null
|
|
63
|
+
render(calls.getCallState());
|
|
87
64
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
(
|
|
91
|
-
|
|
92
|
-
|
|
65
|
+
await calls.place(conversationId, { media: 'audio', sessionToken }); // sessionToken: the user's poolse JWT
|
|
66
|
+
calls.answer();
|
|
67
|
+
calls.decline();
|
|
68
|
+
calls.hangUp();
|
|
69
|
+
calls.setMuted(true);
|
|
70
|
+
calls.setCamera(true);
|
|
93
71
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
72
|
+
// Audio outputs: snapshot.audioOutputs lists the phone, the speaker and each
|
|
73
|
+
// connected headset or Bluetooth device; snapshot.audioOutputId is the one in use.
|
|
74
|
+
function onPickOutput(snapshot: calls.Snapshot, id: string) {
|
|
75
|
+
if (snapshot.audioOutputs.some((o) => o.id === id)) calls.setAudioOutput(id);
|
|
98
76
|
}
|
|
77
|
+
calls.setSpeaker(true); // the one-tap speaker toggle
|
|
99
78
|
```
|
|
100
79
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- `android/src/main/java/dev/poolse/callcore/` — the pure state machine
|
|
140
|
-
and ports (contract cv 1).
|
|
141
|
-
- `android/src/main/java/dev/poolse/callcore/android/` — the Android
|
|
142
|
-
adapters (HTTP, timers, ring surface, foreground service, FCM intake,
|
|
143
|
-
composition root).
|
|
144
|
-
- `android/src/main/java/expo/modules/poolsecalls/` — the Expo bridge
|
|
145
|
-
module (compiled by the app's autolinking).
|
|
146
|
-
- `android/src/main/livekit/` — the shipped LiveKit `MediaPort`, opt-in
|
|
147
|
-
via the `poolse.livekit` gradle property; the core is SFU-agnostic.
|
|
148
|
-
|
|
149
|
-
Stage 3 adds the Swift core under `ios/`.
|
|
80
|
+
The full API:
|
|
81
|
+
|
|
82
|
+
- Setup: `configure`, `nativeCallsAvailable`, `getCallState`, `onCallState`.
|
|
83
|
+
- Calls: `place`, `join`, `answer`, `decline`, `hangUp`, `setMuted`,
|
|
84
|
+
`setCamera`, `switchCamera`, `setSpeaker`, `setAudioOutput`,
|
|
85
|
+
`ringIntoCall({ userIds?, externalIds? })`.
|
|
86
|
+
- Rooms (nobody rings): `startRoom(conversationId, { media, sessionToken })`,
|
|
87
|
+
then `join` for the others and `hangUp` to leave.
|
|
88
|
+
- Call waiting: `snapshot.waiting`, `answerWaiting(callId)`,
|
|
89
|
+
`declineWaiting(callId)`.
|
|
90
|
+
- Video: `<CallVideoView participantId | local mirror fit pictureInPicture />`,
|
|
91
|
+
`setPictureInPictureEnabled`, `isInPictureInPicture`,
|
|
92
|
+
`pictureInPictureSupported`, `onPictureInPicture`.
|
|
93
|
+
- Android: `canUseFullScreenIntent`, `openFullScreenIntentSettings`,
|
|
94
|
+
`setShowOnLockscreen`, `takeCallAction`, `onCallAction`.
|
|
95
|
+
- iOS VoIP token: `getVoipToken`, `onVoipToken`. Register it with
|
|
96
|
+
`poolse.devices.register({ token, platform: 'ios', kind: 'voip', environment })`
|
|
97
|
+
from `@poolse/sdk`, and the regular APNs token with `kind: 'alert'`.
|
|
98
|
+
- Chat notifications: `setActiveConversation`, `shouldPresentMessage`,
|
|
99
|
+
`conversationOfNotification`.
|
|
100
|
+
- Socket forwarding (optional): `onCallFinished`, `onRingEnded`. Feed them
|
|
101
|
+
from `@poolse/sdk` 3.1's user channel:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
const userChannel = poolse.realtime.user(me.id);
|
|
105
|
+
userChannel.onRingEnded((e) => calls.onRingEnded(e.call_id, e.reason));
|
|
106
|
+
userChannel.onCallFinished((e) => calls.onCallFinished(e.call_id, e.reason));
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Links
|
|
110
|
+
|
|
111
|
+
- Docs: <https://poolse.dev/docs/sdk/native>
|
|
112
|
+
- Source: <https://github.com/poolse-hq/js-sdk>
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
Licensed under the [poolse SDK License](./LICENSE) from 3.0.0; versions
|
|
117
|
+
before 3.0.0 remain MIT.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poolse/native",
|
|
3
|
-
"version": "3.0.0",
|
|
4
|
-
"description": "Native call core for poolse
|
|
3
|
+
"version": "3.2.0-dev.0",
|
|
4
|
+
"description": "Native call core for poolse — Kotlin/Swift calling engine with a thin React Native bridge. Ring, answer and carry audio with the app killed and the phone locked.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"LICENSE",
|
|
38
38
|
"CHANGELOG.md"
|
|
39
39
|
],
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "tsup",
|
|
42
|
-
"prepublishOnly": "tsup",
|
|
43
|
-
"typecheck": "tsc --noEmit"
|
|
44
|
-
},
|
|
45
40
|
"peerDependencies": {
|
|
46
41
|
"expo": "*",
|
|
47
42
|
"expo-notifications": "*",
|
|
43
|
+
"react": "*",
|
|
48
44
|
"react-native": "*"
|
|
49
45
|
},
|
|
50
46
|
"devDependencies": {
|
|
51
47
|
"expo-modules-core": "*",
|
|
52
48
|
"tsup": "^8.3.5",
|
|
53
49
|
"typescript": "^5.6.0"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsup",
|
|
53
|
+
"typecheck": "tsc --noEmit"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|