@robono/calling-react-native 0.0.0-stage → 0.2.1
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 +32 -0
- package/LICENSE +130 -0
- package/README.md +153 -2
- package/RobonoCallingRuntime.podspec +15 -0
- package/SBOM.spdx.json +983 -0
- package/android/build.gradle +8 -0
- package/android/src/main/AndroidManifest.xml +8 -0
- package/android/src/main/java/com/robono/calling/CallingPackage.java +15 -0
- package/android/src/main/java/com/robono/calling/CallingRuntime.java +75 -0
- package/android/src/main/java/com/robono/calling/CallingService.java +99 -0
- package/app.plugin.cjs +17 -0
- package/assets/bell.wav +0 -0
- package/assets/click.wav +0 -0
- package/assets/connecting.wav +0 -0
- package/assets/ended.wav +0 -0
- package/assets/marimba.wav +0 -0
- package/assets/pulse.wav +0 -0
- package/assets/ringing.wav +0 -0
- package/dist/appearance.d.ts +64 -0
- package/dist/appearance.js +126 -0
- package/dist/audio.d.mts +6 -0
- package/dist/audio.mjs +89 -0
- package/dist/controller.d.mts +7 -0
- package/dist/controller.mjs +211 -0
- package/dist/expo-notifications.d.ts +12 -0
- package/dist/expo-notifications.js +44 -0
- package/dist/history.d.ts +16 -0
- package/dist/history.js +12 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +23 -0
- package/dist/native.d.ts +18 -0
- package/dist/native.js +174 -0
- package/dist/notification-router.d.ts +18 -0
- package/dist/notification-router.js +59 -0
- package/dist/notifications.d.ts +37 -0
- package/dist/notifications.js +84 -0
- package/dist/runtime.d.ts +21 -0
- package/dist/runtime.js +227 -0
- package/dist/screens.d.ts +60 -0
- package/dist/screens.js +59 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.js +1 -0
- package/examples/CallingHost.tsx +204 -0
- package/examples/ExpoCallingHost.tsx +42 -0
- package/ios/RobonoCallingRuntime.m +84 -0
- package/package.json +104 -4
- package/react-native.config.js +4 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changes
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- 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.
|
|
6
|
+
|
|
7
|
+
## 0.2.0
|
|
8
|
+
|
|
9
|
+
- Saved branding, labels and event sounds shared with the website preview.
|
|
10
|
+
- Optional component inventory; standalone and Bridge calling use the same interface.
|
|
11
|
+
- Existing audio-session ownership and interruption behavior retained.
|
|
12
|
+
|
|
13
|
+
## 0.1.0
|
|
14
|
+
|
|
15
|
+
- Optional incoming, outgoing, connecting and connected screens with theme and label overrides.
|
|
16
|
+
- A controller separate from rendering; no automatic navigation or notification registration.
|
|
17
|
+
- Mobile WebRTC, microphone, speaker and audio-cue adapter in a separate entry point.
|
|
18
|
+
- Original ringing, connecting and hangup assets.
|
|
19
|
+
- Account-scoped notification ordering and authenticated call lookup.
|
|
20
|
+
- A React Native integration example.
|
|
21
|
+
- Continuous notification startup, account cleanup, idle session renewal and availability recovery in the included host example.
|
|
22
|
+
- Per-call Speaker selection and repeatable local/remote hangup tones.
|
|
23
|
+
- Stopping audio cues preserves the iPhone's shared WebRTC audio session until call cleanup.
|
|
24
|
+
- Established calls hold during system audio interruptions, preserving mute and speaker choices. Resume revalidates the call and audio availability; Both platforms offer manual Resume when needed. Setup interruptions still end silently.
|
|
25
|
+
- Resume shows progress and actionable errors; repeated taps share one request, and late errors cannot reopen an ended call.
|
|
26
|
+
- Expired or revoked sessions clear connected-call controls.
|
|
27
|
+
- Safe-area-aware controls keep call actions above Android navigation bars and iPhone home indicators.
|
|
28
|
+
|
|
29
|
+
- Optional Android active-call service and iPhone audio-interruption runtime, with account/call ownership and cleanup.
|
|
30
|
+
- Call-scoped native scheduling keeps connection checks and audio cleanup running in the background, with connection-loss deadlines and release on hangup.
|
|
31
|
+
- Expo notification connection and provider-neutral router, durable per-account ordering, cold-start handoff and stale-notification dismissal.
|
|
32
|
+
- Expo configuration plugin and complete notification host example; existing native calling integrations can supply their own lifetime adapter.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
ROBONO SDK LICENSE AGREEMENT
|
|
2
|
+
Version 1.0, July 20, 2026
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 Add to Loop LLC. All rights reserved.
|
|
5
|
+
|
|
6
|
+
This Robono SDK License Agreement (the "Agreement") is between Add to Loop LLC,
|
|
7
|
+
operating the Robono service ("Robono"), and the person or entity that downloads,
|
|
8
|
+
installs, copies, or uses the Software ("You"). By downloading, installing,
|
|
9
|
+
copying, or using the Software, You accept this Agreement. If You do not accept
|
|
10
|
+
it, do not use the Software.
|
|
11
|
+
|
|
12
|
+
1. Definitions
|
|
13
|
+
|
|
14
|
+
"Software" means this Robono software development kit, its documentation, and
|
|
15
|
+
any updates Robono provides under this Agreement.
|
|
16
|
+
|
|
17
|
+
"Robono Service" means the messaging interoperability, routing, policy,
|
|
18
|
+
conversion, delivery, and related services operated or expressly authorized by
|
|
19
|
+
Robono.
|
|
20
|
+
|
|
21
|
+
"Application" means a product or service owned or controlled by You that is
|
|
22
|
+
authorized to connect to the Robono Service.
|
|
23
|
+
|
|
24
|
+
2. Limited License
|
|
25
|
+
|
|
26
|
+
Subject to this Agreement, Robono grants You a limited, non-exclusive,
|
|
27
|
+
non-transferable, non-sublicensable, revocable license to:
|
|
28
|
+
|
|
29
|
+
(a) install, copy, and use the Software internally to develop, test, and
|
|
30
|
+
operate an Application that communicates with the Robono Service; and
|
|
31
|
+
|
|
32
|
+
(b) reproduce and distribute the portions of the Software that are necessarily
|
|
33
|
+
included in Your Application, solely in compiled, minified, bundled, or object
|
|
34
|
+
code form and solely as needed for that Application to communicate with the
|
|
35
|
+
Robono Service.
|
|
36
|
+
|
|
37
|
+
No right is granted to distribute the Software as a standalone product or SDK.
|
|
38
|
+
|
|
39
|
+
3. Restrictions
|
|
40
|
+
|
|
41
|
+
You may not, and may not permit another person to:
|
|
42
|
+
|
|
43
|
+
(a) sell, rent, lease, sublicense, publish, or redistribute the Software as a
|
|
44
|
+
standalone product, library, SDK, or service;
|
|
45
|
+
|
|
46
|
+
(b) use the Software or a modified or derivative version of it to develop,
|
|
47
|
+
provide, or support a product or service that competes with the Robono Service;
|
|
48
|
+
|
|
49
|
+
(c) use the Software to bypass Robono, avoid applicable usage controls or fees,
|
|
50
|
+
or access the Robono Service without authorization;
|
|
51
|
+
|
|
52
|
+
(d) remove or alter copyright, trademark, attribution, or proprietary notices;
|
|
53
|
+
|
|
54
|
+
(e) reverse engineer, decompile, or disassemble the Software except to the
|
|
55
|
+
limited extent applicable law expressly prohibits this restriction; or
|
|
56
|
+
|
|
57
|
+
(f) use the Software in violation of applicable law, the rights of another
|
|
58
|
+
person, or the terms governing access to the Robono Service.
|
|
59
|
+
|
|
60
|
+
4. Ownership and Reserved Rights
|
|
61
|
+
|
|
62
|
+
The Software is licensed, not sold. Robono and its licensors retain all right,
|
|
63
|
+
title, and interest in the Software and all related intellectual property.
|
|
64
|
+
Except for the limited rights expressly granted in Section 2, all rights are
|
|
65
|
+
reserved.
|
|
66
|
+
|
|
67
|
+
No patent license is granted except the minimum license, if any, necessarily
|
|
68
|
+
required to exercise the rights expressly granted in Section 2, and that
|
|
69
|
+
limited patent license applies only while the Software is used with an
|
|
70
|
+
authorized Robono Service.
|
|
71
|
+
|
|
72
|
+
5. Service Access
|
|
73
|
+
|
|
74
|
+
This Agreement does not itself grant an account, API credentials, service
|
|
75
|
+
availability, support, or a right to access the Robono Service. Service access
|
|
76
|
+
may be governed by additional terms, plans, limits, and policies. Robono may
|
|
77
|
+
suspend or terminate access to protect users, systems, legal compliance, or the
|
|
78
|
+
integrity of the Robono Service.
|
|
79
|
+
|
|
80
|
+
6. Updates and Support
|
|
81
|
+
|
|
82
|
+
Robono is not required to provide maintenance, updates, support, or continued
|
|
83
|
+
availability of any version of the Software unless separately agreed in
|
|
84
|
+
writing.
|
|
85
|
+
|
|
86
|
+
7. Term and Termination
|
|
87
|
+
|
|
88
|
+
This Agreement continues until terminated. Your rights terminate automatically
|
|
89
|
+
if You breach this Agreement. On termination, You must stop using the Software
|
|
90
|
+
and delete copies under Your control, except for copies necessarily contained
|
|
91
|
+
in previously distributed Applications. Sections 3, 4, 8, 9, 10, and 11
|
|
92
|
+
survive termination.
|
|
93
|
+
|
|
94
|
+
8. Disclaimer of Warranties
|
|
95
|
+
|
|
96
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" AND
|
|
97
|
+
"AS AVAILABLE," WITHOUT WARRANTIES OF ANY KIND, EXPRESS, IMPLIED, OR
|
|
98
|
+
STATUTORY, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
99
|
+
PURPOSE, TITLE, AND NON-INFRINGEMENT.
|
|
100
|
+
|
|
101
|
+
9. Limitation of Liability
|
|
102
|
+
|
|
103
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, ROBONO WILL NOT BE LIABLE FOR INDIRECT,
|
|
104
|
+
INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR LOSS
|
|
105
|
+
OF DATA, REVENUE, PROFITS, GOODWILL, OR BUSINESS OPPORTUNITY, ARISING FROM OR
|
|
106
|
+
RELATING TO THE SOFTWARE. ROBONO'S TOTAL LIABILITY RELATING TO THE SOFTWARE
|
|
107
|
+
WILL NOT EXCEED THE GREATER OF ONE HUNDRED U.S. DOLLARS (US $100) OR THE AMOUNT
|
|
108
|
+
YOU PAID ROBONO FOR THE SOFTWARE DURING THE TWELVE MONTHS BEFORE THE EVENT
|
|
109
|
+
GIVING RISE TO THE CLAIM. THESE LIMITATIONS APPLY TO THE MAXIMUM EXTENT
|
|
110
|
+
PERMITTED BY LAW.
|
|
111
|
+
|
|
112
|
+
10. Governing Law
|
|
113
|
+
|
|
114
|
+
This Agreement is governed by the laws of the State of Florida, excluding its
|
|
115
|
+
conflict-of-laws rules. The state and federal courts located in Palm Beach
|
|
116
|
+
County, Florida have exclusive jurisdiction, and each party consents to their
|
|
117
|
+
jurisdiction and venue.
|
|
118
|
+
|
|
119
|
+
11. General
|
|
120
|
+
|
|
121
|
+
You may not assign this Agreement without Robono's prior written consent.
|
|
122
|
+
Robono may assign this Agreement in connection with a reorganization, transfer
|
|
123
|
+
of intellectual property, financing, merger, acquisition, or sale of all or
|
|
124
|
+
substantially all of the relevant assets. If a provision is unenforceable, it
|
|
125
|
+
will be enforced to the maximum extent permitted and the remaining provisions
|
|
126
|
+
will remain effective. A waiver must be in writing. This Agreement is the
|
|
127
|
+
entire agreement concerning the Software unless You and Robono sign a separate
|
|
128
|
+
written agreement that expressly replaces it.
|
|
129
|
+
|
|
130
|
+
Questions about this license may be submitted at https://robono.com/contact.
|
package/README.md
CHANGED
|
@@ -1,3 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Robono mobile calling
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Optional React Native screens, sounds and audio adapters for one-to-one voice 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
|
+
|
|
5
|
+
Choose the pieces you want:
|
|
6
|
+
|
|
7
|
+
| Your app needs | Use |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Its own calling interface | `@robono/calling` alone, or the calling HTTP API |
|
|
10
|
+
| Ready-made screens and controls | `CallingOverlay` with `createCallingController` |
|
|
11
|
+
| A screen inside its own navigation | `CallingScreen` with controlled state and callbacks |
|
|
12
|
+
| Mobile microphone and audio handling | `createNativeCallAdapters` from the separate `/native` entry point |
|
|
13
|
+
| Incoming notification routing | `/expo-notifications` for Expo, or `/notification-router` with your existing push provider |
|
|
14
|
+
| Background call lifetime | `/runtime` for Android ongoing-call service and iPhone audio interruptions |
|
|
15
|
+
| Entries inside an existing conversation | `CallHistoryItem` with your chat bubble colors |
|
|
16
|
+
|
|
17
|
+
Installing the engine never installs or opens these screens. Importing this package does not register a push handler, ask for permissions, modify navigation or start audio. Screens appear only where your app explicitly renders them. You can use your own screens with the supplied audio adapter, or the supplied screens with your own audio adapter.
|
|
18
|
+
|
|
19
|
+
## Install and configure
|
|
20
|
+
|
|
21
|
+
Install the versioned calling engine and the optional mobile package from npm:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install @robono/calling@0.1.2 @robono/calling-react-native@0.2.1
|
|
25
|
+
```
|
|
26
|
+
The screens need React, React Native, React Native SVG and Safe Area Context 5. The native audio and notification adapters support the following Expo dependency families:
|
|
27
|
+
|
|
28
|
+
| Your Expo SDK | Expo Audio | Expo Crypto | Expo Notifications | WebRTC config plugin |
|
|
29
|
+
| --- | --- | --- | --- | --- |
|
|
30
|
+
| 54 | 1.1.1 or later 1.x | 15.0.9 or later 15.x | 0.32.17 or later 0.32.x | 13.x |
|
|
31
|
+
| 55 | 55.x | 55.x | 55.x | 14.x |
|
|
32
|
+
| 56 | 56.x | 56.x | 56.x | 15.x |
|
|
33
|
+
|
|
34
|
+
Keep your app's Expo version. Let Expo select its matching native dependencies:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npx expo install react-native-svg react-native-safe-area-context expo-audio expo-crypto expo-notifications
|
|
38
|
+
npm install react-native-webrtc@124.0.8 react-native-incall-manager@4.3.0
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Install the WebRTC config plugin matching the table, for example `npm install @config-plugins/react-native-webrtc@13` for Expo 54. Commit the lockfile. Do not use `--force` or `--legacy-peer-deps` to hide an incompatible version.
|
|
42
|
+
|
|
43
|
+
Add these entries to your existing Expo `plugins` list:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
["@config-plugins/react-native-webrtc", "expo-audio", "expo-notifications", "@robono/calling-react-native/app.plugin"]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The package name `@robono/calling-react-native` and the `/app.plugin.js` and `/app.plugin.cjs` aliases also resolve to the same plugin. Existing `/app.plugin` integrations need no changes. Keep your app's existing push credentials. Make one development or release build after adding native dependencies; Expo Go cannot load WebRTC. Ordinary screen and copy changes do not require a native rebuild.
|
|
50
|
+
|
|
51
|
+
These dependencies are optional peers. Apps using only the screens do not need Expo audio, notifications or WebRTC. Apps using their own calling client can keep their existing audio and notification adapters.
|
|
52
|
+
|
|
53
|
+
On iPhone, configure `NSMicrophoneUsageDescription` with your app's explanation and the `audio` background mode for ongoing calls. On Android, declare `RECORD_AUDIO`, `MODIFY_AUDIO_SETTINGS`, and `INTERNET`; obtain notification permission on Android 13+. For Bluetooth audio on Android 12+, declare and obtain `BLUETOOTH_CONNECT` through your app's permission flow. The optional native runtime supplies Android’s microphone foreground service and its ongoing-call notification. It starts only after microphone permission, while the app is visible, when the user makes or answers a call. Locking the phone after answering keeps that service running. Tapping its notification returns to your app; End releases the call. The service does not restart a call after the app is terminated. On iPhone, the runtime observes audio interruptions and holds an established call when another call takes the microphone; it never installs CallKit. If your app already owns call lifetime, pass your existing adapter instead of starting a second service. Screens-only applications can disable native autolinking for this package in their React Native configuration.
|
|
54
|
+
|
|
55
|
+
Unanswered calls stop after 30 seconds from call creation. The service records No answer for the caller and the history helper displays Missed call for the recipient. The client also stops ringing at the supplied deadline if a status request stalls. Answering does not restart the ringing deadline.
|
|
56
|
+
|
|
57
|
+
## Add the optional interface
|
|
58
|
+
|
|
59
|
+
The complete `examples/CallingHost.tsx` component accepts your authenticated session function, service origin, contact information and accepted Bridge connection. Mount it under your account provider. `getSession` calls your backend, which authenticates the current user and exchanges a Robono admission ticket; network API keys never belong in mobile code.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { createHttpTransport } from '@robono/calling';
|
|
63
|
+
import { createCallingController, CallingOverlay } from '@robono/calling-react-native';
|
|
64
|
+
import { createNativeCallAdapters } from '@robono/calling-react-native/native';
|
|
65
|
+
import { createNativeCallRuntime } from '@robono/calling-react-native/runtime';
|
|
66
|
+
|
|
67
|
+
const runtime = createNativeCallRuntime({
|
|
68
|
+
notificationTitle: 'Voice call', notificationText: 'Call in progress',
|
|
69
|
+
channelName: 'Ongoing calls', endLabel: 'End call', onError: showCallError,
|
|
70
|
+
});
|
|
71
|
+
const adapters = createNativeCallAdapters({
|
|
72
|
+
runtime,
|
|
73
|
+
ringtone: 'robono',
|
|
74
|
+
restoreAudio: restoreYourNormalAudioMode,
|
|
75
|
+
onError: showAudioError,
|
|
76
|
+
});
|
|
77
|
+
const calling = createCallingController({
|
|
78
|
+
request: createHttpTransport({baseUrl: session.serviceUrl, token: session.token}),
|
|
79
|
+
...adapters,
|
|
80
|
+
resolveContact: id => contactsByConnectionId[id] || null,
|
|
81
|
+
onError: showCallError,
|
|
82
|
+
});
|
|
83
|
+
runtime.attach(calling);
|
|
84
|
+
await calling.listen();
|
|
85
|
+
|
|
86
|
+
// Render once at your app's root, above ordinary chat navigation:
|
|
87
|
+
<CallingOverlay controller={calling} labels={{call: 'Voice call'}} />
|
|
88
|
+
|
|
89
|
+
// From your contact's call action, after checking availability:
|
|
90
|
+
await calling.call(connectionId, {name: contact.name, avatarUri: contact.avatar});
|
|
91
|
+
// On logout, dispose before creating another account's controller:
|
|
92
|
+
try { await calling.dispose(); } finally { await runtime.dispose(); }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Keep one controller per signed-in device across navigation. Dispose it on logout. Stop your app's other recorder before starting a call. `restoreAudio` restores the host's normal audio mode after a call, so voice messages and other playback keep their existing behavior. The supplied runtime connects native interruption callbacks to `calling.interrupt()`: microphone, received audio and cues are silenced, and both screens show Call on hold. The existing call remains available for up to five minutes. Android audio-focus gain and iPhone interruption-end with permission to resume trigger a fresh server check before audio returns. If automatic resumption does not occur, the local screen offers Resume call on both iPhone and Android. While checking the call it shows Resuming; if audio is still in use or the service cannot be reached, it explains the problem and allows another attempt. This checks audio availability and the current call before enabling tracks; it preserves mute and speaker preferences. Either person can end the held call. A lost transport, expired hold or revoked connection cannot be silently reopened. If you supply your own lifetime adapter, connect those same interruption and resume actions. For your own interface, use `resumePending` to prevent duplicate taps and `resumeError` to explain a failed attempt. For a controlled `CallingScreen`, pass `onResume={() => calling.resume()}` as well as the ordinary controls. Calls still being set up end silently if audio is interrupted.
|
|
96
|
+
|
|
97
|
+
The host example refreshes contact availability and respects the server's retry delay. It renews sessions before expiry while idle, waits for previous audio cleanup on account changes, and offers reconnection after access ends. It never transfers an active call to a newly admitted session. Pass `expiresAt` as Unix milliseconds from the session response. Keep the controller at app level so changing chat screens does not end an ongoing call.
|
|
98
|
+
|
|
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
|
+
|
|
101
|
+
## Sounds and routes
|
|
102
|
+
|
|
103
|
+
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.
|
|
104
|
+
|
|
105
|
+
The supplied assets may also be used by your own audio implementation under the SDK license. They contain no speech or third-party recordings.
|
|
106
|
+
|
|
107
|
+
## Use your existing notifications
|
|
108
|
+
|
|
109
|
+
Keep the app's push registration, permission requests, privacy preferences, icon and notification handler. Robono's signed `calling.incoming` and `calling.dismissed` webhooks go to your backend. Verify them and use `toCallingPushPayload` from `@robono/server` to create the routing payload. Send it only to devices belonging to the recipient account. Set expiration to the ringing deadline.
|
|
110
|
+
|
|
111
|
+
`createCallingNotificationStore(AsyncStorage)` supplies account-scoped durable ordering using your existing AsyncStorage installation. Corrupt storage fails closed rather than reopening an old invitation.
|
|
112
|
+
|
|
113
|
+
For Expo, use the included `examples/ExpoCallingHost.tsx` above your chat navigation. It connects initial notification responses, later taps and received events to the same call layer. Supply your account, session function, contacts, durable store, and `recipientAccount(data)` to read the account identifier your backend attaches to each push. Only a matching signed-in account can consume that notification. The helper leaves unrelated notifications and the app’s global notification handler intact. No permission prompt or token registration happens on import.
|
|
114
|
+
|
|
115
|
+
Wrap your existing Expo handler with `withCallingNotificationPresentation(existingHandler, canPresentCall)` when registering it with `Notifications.setNotificationHandler`. `canPresentCall` returns true only when your signed-in call layer is ready; until then, normal alerts remain enabled. This preserves all ordinary message notifications. For another provider, call `callingNotificationPresentation(data, isForeground)`: `screen` means suppress the duplicate banner and sound, `notification` means use your ordinary alert, `dismiss` means suppress a stale/cancelled invitation, and `null` means keep your normal handling. Background alerts are sent by your backend through your existing push provider; the mobile library does not send push notifications.
|
|
116
|
+
|
|
117
|
+
For another provider, use `createCallingNotificationRouter` with the same durable store, recipient check, `open`, `refresh` and `dismiss` callbacks. `open` sets the root call layer immediately; it does not wait for the calling session request.
|
|
118
|
+
|
|
119
|
+
`createCallingNotificationHandler` accepts your controller, an account-specific durable store and a function that dismisses your app's notification by call ID. Pass notification data to `handle(data)` on receipt and `handle(data, {opened: true})` when tapped. It deduplicates events, retains dismissal ordering for 24 hours, rejects expired invitations, and refreshes the authenticated call before enabling Answer. Disposal prevents a late event from operating a signed-out account. A notification never answers or opens the microphone by itself.
|
|
120
|
+
|
|
121
|
+
Mount the call layer above normal navigation during startup. Once authentication is restored, pass the tapped call ID to `openIncoming`; its loading state stays on the same call screen until the server confirms the call. Check the initial notification response as well as subsequent taps. Clear the consumed response so restarting the app does not reopen it. Dismissal removes an incoming notification; it must not end a call that was already answered.
|
|
122
|
+
|
|
123
|
+
The host example keeps one full-screen layer visible while the session and incoming call load. Pass `notificationCallId` as soon as the tap is known, and use `onNotificationConsumed` to clear it from your router and notification provider. Closing during startup prevents the delayed lookup from reopening that notification. Render this host above any authentication-loading page; only mount it for the account that owns the notification.
|
|
124
|
+
|
|
125
|
+
When the app is open, use the screen and suppress the additional incoming notification banner and sound through your existing foreground handler. When another app is open or the phone is locked, use the receiving app's ordinary notification. A tap opens the receiving app, with unlocking when required. iOS controls banner presentation and alert delivery. An ordinary notification does not provide a custom locked-screen Answer button or guaranteed ringing. Android apps that already provide native calling notifications can keep those and forward their explicit Answer action after validating current call state.
|
|
126
|
+
|
|
127
|
+
## Relationships and existing calls
|
|
128
|
+
|
|
129
|
+
The UI does not impose a network topology. The engine accepts the authorized Bridge connection ID: `bridge:…` for two connected networks, or `app:…` for a Messenger endpoint. A local chat ID is not a Bridge connection ID. Existing calls between people inside one external network can continue through that network's own engine, using `CallingScreen` if desired. For two users inside your own network, your backend registers their existing calling permission with `setRelationship` and uses the returned `network:…` connection. Updates carry a monotonically increasing revision so a delayed permission grant cannot undo a later block. The Bridge does not invent friendships between arbitrary users.
|
|
130
|
+
|
|
131
|
+
## Verify in your app
|
|
132
|
+
|
|
133
|
+
Use the developer workspace to verify the Bridge connection, then test the chosen interface and native integration on physical iPhone and Android devices. Check two-way speech, speaker before and after connection, mute, Bluetooth, interruptions, cancellation during permission prompts, notification taps on a cold start, account switching and background operation. Verify existing messages, voice recordings and calls still work.
|
|
134
|
+
|
|
135
|
+
[Calling guide](https://robono.com/docs#calling) · [Calling API](https://robono.com/api-reference?spec=calling) · [Support](https://robono.com/contact?topic=sdk)
|
|
136
|
+
|
|
137
|
+
## Saved branding and sounds
|
|
138
|
+
|
|
139
|
+
Screens are optional for standalone calling and Bridge integrations. In the website's Calling workspace, choose an integration, set its name, logo, colors and text, 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
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
const appearance = validateCallingAppearance(session.appearance);
|
|
143
|
+
const adapters = createNativeCallAdapters({appearance, runtime, restoreAudio, onError});
|
|
144
|
+
const controller = createCallingController({request, ...adapters,
|
|
145
|
+
appearanceRevision: session.appearanceRevision});
|
|
146
|
+
// Mount once at your application root:
|
|
147
|
+
<CallingOverlay controller={controller} appearance={appearance} />
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
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
|
+
|
|
152
|
+
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
|
+
|
|
154
|
+
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.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
3
|
+
Pod::Spec.new do |s|
|
|
4
|
+
s.name = 'RobonoCallingRuntime'
|
|
5
|
+
s.version = package['version']
|
|
6
|
+
s.summary = package['description']
|
|
7
|
+
s.homepage = 'https://robono.com/docs#calling'
|
|
8
|
+
s.license = { :type => 'SEE LICENSE IN LICENSE', :file => 'LICENSE' }
|
|
9
|
+
s.author = 'Robono'
|
|
10
|
+
s.source = { :git => 'https://github.com/IMLX16/robono-sdks.git', :tag => 'calling-v0.1.1' }
|
|
11
|
+
s.platforms = { :ios => '15.1' }
|
|
12
|
+
s.source_files = 'ios/*.{h,m}'
|
|
13
|
+
s.frameworks = 'AVFAudio', 'UIKit'
|
|
14
|
+
s.dependency 'React-Core'
|
|
15
|
+
end
|