@robono/calling-react-native 0.2.1 → 0.3.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 +17 -0
- package/README.md +108 -2
- package/RobonoCallingRuntime.podspec +1 -1
- package/SBOM.spdx.json +972 -156
- package/android/build.gradle +1 -1
- package/android/consumer-rules.pro +5 -0
- package/android/src/main/java/com/robono/calling/CallingRuntime.java +21 -0
- package/app.plugin.cjs +4 -2
- package/broadcast/SampleHandler.swift +92 -0
- package/dist/CallRecord.d.ts +19 -0
- package/dist/CallRecord.js +22 -0
- package/dist/appearance.d.ts +69 -4
- package/dist/appearance.js +70 -5
- package/dist/components.d.ts +135 -0
- package/dist/components.js +185 -0
- package/dist/controller.d.mts +1 -1
- package/dist/controller.mjs +59 -7
- package/dist/expo-notifications.d.ts +1 -1
- package/dist/expo-notifications.js +3 -3
- package/dist/group-phase.d.mts +4 -0
- package/dist/group-phase.mjs +26 -0
- package/dist/groups.d.ts +41 -0
- package/dist/groups.js +90 -0
- package/dist/history.d.ts +6 -15
- package/dist/history.js +3 -11
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/native-video.d.ts +8 -0
- package/dist/native-video.js +10 -0
- package/dist/native.d.ts +2 -0
- package/dist/native.js +51 -2
- package/dist/notification-router.d.ts +2 -1
- package/dist/notification-router.js +4 -4
- package/dist/notifications.d.ts +5 -3
- package/dist/notifications.js +7 -5
- package/dist/runtime.d.ts +2 -1
- package/dist/runtime.js +2 -2
- package/dist/screens.d.ts +6 -54
- package/dist/screens.js +17 -42
- package/dist/types.d.ts +38 -1
- package/dist/versions.d.ts +2 -0
- package/dist/versions.js +3 -0
- package/dist/visual/RobonoIcon.d.ts +232 -0
- package/dist/visual/RobonoIcon.js +20 -0
- package/dist/visual/icon-nodes.d.ts +3 -0
- package/dist/visual/icon-nodes.js +2 -0
- package/dist/visual/icon-paths.d.ts +221 -0
- package/dist/visual/icon-paths.js +221 -0
- package/examples/CallingHost.tsx +27 -14
- package/examples/CustomCallingScreen.tsx +64 -0
- package/examples/ExpoGroupCallingHost.tsx +42 -0
- package/examples/GroupCallingHost.tsx +70 -0
- package/ios/RobonoCallingRuntime.m +24 -0
- package/licenses/robono-icons-lucide-license.txt +43 -0
- package/licenses/robono-icons-weather-attribution.txt +1 -0
- package/licenses/robono-icons-weather-license.txt +21 -0
- package/package.json +16 -4
- package/plugin/screensharing.cjs +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
Optional composable calling screens with branding and sound choices, video and group layouts, screen-sharing controls, and coordinated local media playback during calls. Requires @robono/calling 0.2.x.
|
|
6
|
+
|
|
1
7
|
# Changes
|
|
2
8
|
|
|
9
|
+
## Unreleased
|
|
10
|
+
|
|
11
|
+
- Optional video/group overlays and native video rendering, camera controls, screen sharing with Android MediaProjection and an iPhone ReplayKit extension, continuous notification-to-call startup, and website previews using the same components. Existing headless and voice integrations remain optional and unchanged.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- Reusable calling identity, status and controls, with section replacements on the default screen and overlay. `CallingUIProvider` and `useCallingUI` share labels, timer, action availability and state with fully composed layouts.
|
|
15
|
+
- A complete custom-screen example and component replacements in the account/notification host examples. The default screen now uses the same exported components. No calling engine or audio changes.
|
|
16
|
+
|
|
17
|
+
- Optional light, dark and device appearance with independent palettes, font styles, text sizes, compact identity layout, control shapes and contact-photo/call-description visibility. The website preview and mobile screens share the same resolver.
|
|
18
|
+
- Existing saved designs retain their dark palette and layout. Call controls, accessibility text scaling and audio behavior are preserved.
|
|
19
|
+
|
|
3
20
|
## 0.2.1
|
|
4
21
|
|
|
5
22
|
- Make Expo plugin discovery and explicit plugin paths resolve consistently. Accept matching Expo 54, 55 and 56 audio/crypto/notification dependency families. Existing interfaces, sounds, notifications and branding are unchanged.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Robono mobile calling
|
|
2
2
|
|
|
3
|
-
Optional React Native screens, sounds and audio adapters for
|
|
3
|
+
Optional React Native screens, sounds and audio adapters for direct and group voice and video calls within your app or across Robono Bridge. Each person stays in the app they use. Supply your own accounts and navigation, and choose your branding in the Calling workspace.
|
|
4
4
|
|
|
5
5
|
Choose the pieces you want:
|
|
6
6
|
|
|
@@ -98,6 +98,51 @@ The host example refreshes contact availability and respects the server's retry
|
|
|
98
98
|
|
|
99
99
|
`CallingScreen` accepts state and callbacks rather than owning navigation. `CallingOverlay` is the optional full-screen wrapper. Both allow theme and label overrides, a contact avatar, safe-area insets and a friendly error formatter. The overlay and supplied host provide safe-area measurement inside their modal, keeping controls clear of system navigation. When embedding `CallingScreen` directly, use your existing safe-area provider or pass `insets`. Labels can be translated. Answer is on the right, Decline on the left. Speaker is available while calling and connecting. The timer starts at the media connection time. End dismisses the screen; there is no separate ended-call page.
|
|
100
100
|
|
|
101
|
+
## Replace sections or compose a screen
|
|
102
|
+
|
|
103
|
+
Use the same optional package for three levels of customization: the saved website design, replacement sections in the supplied screen, or a layout assembled from individual components. None requires another calling client. Apps with their own interface can continue using the headless SDK without this package.
|
|
104
|
+
|
|
105
|
+
The `components` prop on `CallingScreen` and `CallingOverlay` accepts `Layout`, `Identity`, `Brand`, `Avatar`, `Contact`, `Status`, `Controls`, `AudioControls`, `IncomingControls` and `ActionButton`. Omitted sections retain the default implementation. The `CallingHost` and `ExpoCallingHost` examples accept the same prop. Define replacement component functions outside your render function so they retain local state as call status changes.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import {View} from 'react-native';
|
|
109
|
+
import {
|
|
110
|
+
CallingOverlay, CallingBrand, CallingAvatar, CallingContact, CallingStatus,
|
|
111
|
+
type CallingScreenComponents,
|
|
112
|
+
} from '@robono/calling-react-native';
|
|
113
|
+
|
|
114
|
+
function AppIdentity() {
|
|
115
|
+
return <View style={{alignItems: 'center', gap: 16}}>
|
|
116
|
+
<CallingBrand />
|
|
117
|
+
<CallingAvatar size={72} />
|
|
118
|
+
<CallingContact />
|
|
119
|
+
<CallingStatus />
|
|
120
|
+
</View>;
|
|
121
|
+
}
|
|
122
|
+
const components = {Identity: AppIdentity} satisfies CallingScreenComponents;
|
|
123
|
+
// Reuse the existing controller and saved appearance:
|
|
124
|
+
<CallingOverlay controller={calling} appearance={appearance} components={components} />
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Each replacement is already inside `CallingUIProvider`. `useCallingUI()` returns the current state, resolved theme and labels, contact title, status/duration, errors, typography and guarded action models. A replacement may render the default component with different styles; it does not need to reimplement its behavior. Lower-level replacements still apply inside default sections. If you replace `Identity` entirely, you choose which identity components it includes.
|
|
128
|
+
|
|
129
|
+
| Component | Purpose |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| `CallingLayout` | Scrollable frame with safe-area spacing |
|
|
132
|
+
| `CallingBrand`, `CallingAvatar`, `CallingContact` | App branding, contact photo/initials, name and call description |
|
|
133
|
+
| `CallingStatus` | Connection state, duration, interruption details and errors |
|
|
134
|
+
| `CallingIdentity` | Default combination of branding, contact and status |
|
|
135
|
+
| `CallingIncomingControls` | Decline on the left and Answer on the right |
|
|
136
|
+
| `CallingAudioControls` | Mute and Speaker, including connection setup |
|
|
137
|
+
| `CallingActionButton` | One state-aware `answer`, `decline`, `mute`, `speaker`, `resume`, `end` or `close` action |
|
|
138
|
+
| `CallingControls` | The complete default controls for the current call phase |
|
|
139
|
+
|
|
140
|
+
For your own layout, wrap these components in one `CallingUIProvider`, passing the same state and callbacks used by `CallingScreen`. The provider hides its contents when idle. It manages presentation and the duration display only; it does not start calls, create controllers, register notifications or own audio. Keep the existing account-level host and native lifecycle integration. When composing directly from a controller, continue reporting supplied screens with `controller.reportComponents?.(['screens'])`; this reports component adoption, not billable usage.
|
|
141
|
+
|
|
142
|
+
`CallingActionButton` hides irrelevant actions and disables unavailable ones. For a completely custom button, read `actions[action]` from `useCallingUI()`, respect `visible`, `disabled`, `selected` and `busy`, and call `onPress`. Preserve an accessible label and role. Hidden or disabled action handlers are no-ops; the controller and service still enforce call state and permissions. Keep End available during calls and Close available during loading and errors. Custom layouts should include `CallingStatus` or display its `status` and `error` values so interruption and connection errors remain understandable.
|
|
143
|
+
|
|
144
|
+
See `examples/CustomCallingScreen.tsx` for section replacement, a fully composed layout and a custom button. The components work with either standalone calling or the Bridge. Changing their arrangement does not change audio routing, sounds, authorization or server usage records. Phone-controlled notification banners remain part of the native notification integration.
|
|
145
|
+
|
|
101
146
|
## Sounds and routes
|
|
102
147
|
|
|
103
148
|
The package includes original Robono WAV assets: `ringing.wav`, `connecting.wav` and `ended.wav`. The adapter defaults to the person's system ringtone; choose `ringtone: 'robono'` for the supplied melody. A quiet repeating pulse indicates connecting. A brief descending chime follows an established call ending, including when the other person hangs up. Decline and unanswered cancellation are silent on the recipient's device. Ringing stops when Answer is pressed. Each new call starts with Speaker off. A selection made during connection setup carries through connection; switching Speaker off restores the system's automatic earpiece/headset/Bluetooth choice.
|
|
@@ -136,7 +181,7 @@ Use the developer workspace to verify the Bridge connection, then test the chose
|
|
|
136
181
|
|
|
137
182
|
## Saved branding and sounds
|
|
138
183
|
|
|
139
|
-
Screens are optional for standalone calling and Bridge integrations. In the website's Calling workspace, choose an integration, set its name
|
|
184
|
+
Screens are optional for standalone calling and Bridge integrations. In the website's Calling workspace, choose an integration, set its name and logo, select light, dark or device appearance, and customize colors, fonts, text size, layout, control shape and labels. Preview screens, audition sounds, and save. The backend helper `appearance()` returns `{appearance, revision}`; deliver these alongside the authenticated user's short-lived calling session as `appearance` and `appearanceRevision`.
|
|
140
185
|
|
|
141
186
|
```tsx
|
|
142
187
|
const appearance = validateCallingAppearance(session.appearance);
|
|
@@ -147,8 +192,69 @@ const controller = createCallingController({request, ...adapters,
|
|
|
147
192
|
<CallingOverlay controller={controller} appearance={appearance} />
|
|
148
193
|
```
|
|
149
194
|
|
|
195
|
+
`appearance.presentation` controls `colorMode` (`dark`, `light`, `system`), `font` (`system`, `serif`, `monospace`), `textScale` (`1`, `1.15`, `1.3`), `layout` (`standard`, `compact`), `controlShape` (`round`, `rounded`), `showAvatar` and `showCallDescription`. `theme` stores the dark palette and `lightTheme` the light palette. Existing configurations that omit these additions keep the original dark layout. Device font faces differ between iOS and Android; accessibility text scaling remains enabled. Compact layout reduces the identity area, never the touch targets. Names, call status and controls remain available. These are presentation choices, not calling permissions.
|
|
196
|
+
|
|
150
197
|
The included CallingHost accepts these optional session fields. Use the same validated configuration for the screen and native adapter. Keep it stable during a call. A custom screen can use the headless engine without importing this package.
|
|
151
198
|
|
|
152
199
|
Incoming, outgoing and connecting cues repeat. Other selected cues play once; defaults keep decline and unanswered calls silent. Local audio interruptions always silence cues. The host app's notification configuration and OS govern background notification sounds; changing an in-app sound does not override that configuration. Supplied WAV assets are available from `/assets/*` for your notification integration.
|
|
153
200
|
|
|
154
201
|
The controller reports platform, package versions, configuration revision and optional components through the authenticated calling session. These client-declared inventory records contain no contact or message data and do not set charges. Service usage counts a same-app call once, separates cross-app directions, and records held and connected time independently.
|
|
202
|
+
|
|
203
|
+
### Video calls
|
|
204
|
+
|
|
205
|
+
Video calling is optional and uses the same controller, sounds, interruption handling and conversation history as voice calling. Enable Video calling in the Experience builder. Each relationship must also allow video; show the video button only when `videoAvailable` is true.
|
|
206
|
+
|
|
207
|
+
Use the supplied native video renderer with the optional screens:
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import {NativeCallingOverlay} from '@robono/calling-react-native/native-video';
|
|
211
|
+
|
|
212
|
+
// Call from the user's button. Incoming calls request camera access after Answer.
|
|
213
|
+
await controller.call(connectionId, contact, {kind: 'video'});
|
|
214
|
+
|
|
215
|
+
<NativeCallingOverlay controller={controller} appearance={appearance} />
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
For Expo, set `['@robono/calling-react-native/app.plugin', {video: true}]` in the plugins list. This adds the camera permission description on iPhone and the Android camera permission. Keep your existing microphone permissions and notification integration. Enabling a setting on the website does not grant device permissions or start recording.
|
|
219
|
+
|
|
220
|
+
`NativeCallingOverlay` supplies the camera view, local preview, Camera on/off and Flip camera controls. `CallingVideo` is available as a component when building your own layout. The headless client exposes `onLocalStream` and `onRemoteStream` for an existing interface. Camera and mute selections survive an interrupted call. Backgrounding pauses outgoing video; returning restores the user's camera choice. Audio continues under the existing call policy.
|
|
221
|
+
|
|
222
|
+
Calls are not recorded. If a customer enables a message after no answer, `onUnansweredCall` can navigate to the existing conversation and show the optional message recorder. The caller records a new message and explicitly sends it.
|
|
223
|
+
|
|
224
|
+
### Group calls and screen sharing
|
|
225
|
+
|
|
226
|
+
Enable Group calling in the Experience builder for voice, video, or both. The backend synchronizes two to eight members with `RobonoCallingBackend.setGroup`. Use a separate session and `createGroupCallingController` from `@robono/calling-react-native/groups`; the direct controller continues handling direct calls. Group notifications have separate `calling.group_incoming` and `calling.group_dismissed` event types. Set `group: true` on their notification router. Controllers recheck current permissions and never admit newly added group members into an ongoing call.
|
|
227
|
+
|
|
228
|
+
`examples/GroupCallingHost.tsx` owns account cleanup, session renewal, native call lifetime and interruption handling. Pass stable authenticated callbacks and mount it once under the account provider. Its optional `NativeGroupCallingOverlay` renders the member grid and the same customizable controls, labels and sounds. Import the overlay from `/native-video`. Keep your own UI by using only the controller or engine.
|
|
229
|
+
|
|
230
|
+
Screen sharing is an independent, optional video-call feature. Your backend must also attest `screenSharingAllowed: true` for a same-app pair, or `screenSharing: true` for eligible group members. Cross-app pairs require `calling.screen_sharing: true` in both capability records. Enable it in the builder and set `{video: true, screenSharing: true}` on the Expo plugin. The plugin adds the iOS broadcast extension and shared app group, plus Android capture permissions. Existing native projects need one rebuild after adding these capabilities. Capture starts only with the person’s permission; no phone settings need changing.
|
|
231
|
+
|
|
232
|
+
For iPhone signing, the plugin creates the `RobonoScreenBroadcast` extension with bundle ID `<your ios.bundleIdentifier>.screenbroadcast`. Its default shared container is `group.<your ios.bundleIdentifier>.calling`. In Apple Developer → Certificates, Identifiers & Profiles, register that App Group and select it under **App Groups → Configure** for both your main App ID and the extension App ID. Refresh the two provisioning profiles before building. This is a one-time developer setup for each app variant, not a step for app users. An App Store Connect API key alone does not create or associate the shared container. If you already have a suitable registered group, pass `screenSharing: {appGroup: "group.your.shared.container"}` instead; both targets must belong to it. See [Apple’s App Group setup](https://developer.apple.com/help/account/identifiers/register-an-app-group/).
|
|
233
|
+
|
|
234
|
+
`controller.startScreenSharing()` is called from the user's tap and opens the OS permission picker. `stopScreenSharing()` ends capture and restores the camera's previous enabled state. One participant shares at a time. Microphone audio continues separately; screen audio is not captured. Holding, leaving, or losing authorization stops the share. The supplied screen includes these controls; a custom screen can use the same actions and state. The engine exposes screen-sharing state and streams without imposing an interface.
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
Android screen sharing uses the WebRTC library’s media-projection foreground service. The optional native adapter enables that service before the system consent prompt; the screen-sharing plugin declares its permission. For a non-Expo native project, declare `FOREGROUND_SERVICE_MEDIA_PROJECTION` alongside `FOREGROUND_SERVICE` in the Android manifest. Capture starts only after the person chooses Share screen and accepts the operating system prompt. System sound is not captured. Stopping sharing restores the camera and preserves its previous on/off choice.
|
|
238
|
+
|
|
239
|
+
The included `GroupCallingHost.tsx` handles authenticated group sessions, renewal, account cleanup, continuous notification startup and the optional member grid. `ExpoGroupCallingHost.tsx` connects the group notification events to that host. If your app offers both direct and group calls, keep separate sessions and route each event family to its corresponding host.
|
|
240
|
+
|
|
241
|
+
### Group and video call layout
|
|
242
|
+
|
|
243
|
+
The supplied screen uses the same layout on iOS, Android and the website preview. Participant tiles adapt to the available width and height. Video calls keep Mute, Camera, More and End call in a compact bottom dock; More opens Speaker, Flip camera and Share screen when available. Voice groups keep Mute, Speaker and End call directly visible. A shared screen takes the main view, with other participants in a horizontal strip. Apple and Android still provide their own permission and capture-consent dialogs.
|
|
244
|
+
|
|
245
|
+
These screens remain optional. Existing `components.Controls` and `components.ActionButton` overrides continue to work, and the More label can be customized with `appearance.labels.more`.
|
|
246
|
+
|
|
247
|
+
## Event-based listening
|
|
248
|
+
|
|
249
|
+
Use `@robono/calling@0.1.3` with `@robono/calling-react-native@0.2.2` when using the optional mobile interface. Existing custom interfaces remain supported. See https://robono.com/docs#calling-events for the lifecycle and recovery contract.
|
|
250
|
+
|
|
251
|
+
- Foreground, idle: an authenticated WebSocket listens for incoming calls. No periodic state polling. A ping/pong every 20 seconds maintains presence.
|
|
252
|
+
- Active calls: events trigger state reconciliation immediately; a state health check runs every 3 seconds. The optional native runtime also provides a three-second background recovery check when device timers are suspended; simultaneous refreshes share one request.
|
|
253
|
+
- Idle in background: call `setForeground(false)`. The event socket and state checks stop. Your backend delivers Robono's signed incoming-call events through your app's APNs/FCM notifications. A WebSocket does not replace push delivery.
|
|
254
|
+
- Return to foreground: call `setForeground(true)`. The socket reconnects and current state is checked. Do not create a new call to recover a listening session. The optional controller forwards this lifecycle method to the engine.
|
|
255
|
+
- Event reconnection: delays start at 1 second, double to 30 seconds (plus up to 20% jitter), honor Retry-After, and stop after eight retries. Foreground re-entry can restart recovery. State recovery stops after six consecutive failed idle checks.
|
|
256
|
+
- Expired idle sessions: `onSessionExpired` requests new admission without presenting a failed-call screen. Dispose the expired client and create a new one with a new session from your backend. Use bounded backoff for admission failures. Authorization revocation is not a retryable session expiration. An active call cannot be transferred to a new session.
|
|
257
|
+
|
|
258
|
+
`createHttpTransport` supplies the event subscription automatically. If wrapping it, preserve `request.subscribe = transport.subscribe`. A custom request without `subscribe`, or `{events:false}`, retains the compatibility polling interval (`pollMs`, default 1000 ms).
|
|
259
|
+
|
|
260
|
+
The 0.1.2 engine had polling and retry backoff but did not include this event transport. No native permissions or rebuild are added by this JavaScript patch to an app already using the native calling package.
|
|
@@ -10,6 +10,6 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.source = { :git => 'https://github.com/IMLX16/robono-sdks.git', :tag => 'calling-v0.1.1' }
|
|
11
11
|
s.platforms = { :ios => '15.1' }
|
|
12
12
|
s.source_files = 'ios/*.{h,m}'
|
|
13
|
-
s.frameworks = 'AVFAudio', 'UIKit'
|
|
13
|
+
s.frameworks = 'AVFAudio', 'UIKit', 'ReplayKit'
|
|
14
14
|
s.dependency 'React-Core'
|
|
15
15
|
end
|