@robono/calling-react-native 0.9.2 → 0.10.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 +1 -1
- package/SBOM.spdx.json +36 -36
- package/dist/appearance.d.ts +20 -3
- package/dist/appearance.js +29 -4
- package/dist/components.d.ts +2 -1
- package/dist/components.js +12 -15
- package/dist/device-check-panel.d.ts +8 -1
- package/dist/device-check-panel.js +4 -4
- package/dist/messenger.js +32 -5
- package/dist/screens.js +2 -1
- package/dist/versions.d.ts +2 -2
- package/dist/versions.js +2 -2
- package/examples/CallingHost.tsx +2 -2
- package/examples/GroupCallingHost.tsx +2 -2
- package/ios/RobonoSystemCalling.m +5 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ const adapters = createNativeCallAdapters({
|
|
|
83
83
|
onError: showAudioError,
|
|
84
84
|
});
|
|
85
85
|
const calling = createCallingController({
|
|
86
|
-
request: createHttpTransport({baseUrl: session.serviceUrl, token: session.token}),
|
|
86
|
+
request: createHttpTransport({baseUrl: session.serviceUrl, token: session.token, eventsToken: session.eventsToken}),
|
|
87
87
|
...adapters,
|
|
88
88
|
resolveContact: id => contactsByConnectionId[id] || null,
|
|
89
89
|
onError: showCallError,
|
package/SBOM.spdx.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"spdxVersion": "SPDX-2.3",
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
|
-
"name": "@robono/calling-react-native@0.
|
|
6
|
-
"documentNamespace": "https://robono.com/sbom/calling-react-native/0.
|
|
5
|
+
"name": "@robono/calling-react-native@0.10.0",
|
|
6
|
+
"documentNamespace": "https://robono.com/sbom/calling-react-native/0.10.0/b6d3cebe85ceea06d48694c5ed669a1f73d4ad7c",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-11-
|
|
8
|
+
"created": "2026-11-10T08:50:25.619Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Organization: Robono (support@robono.com)"
|
|
11
11
|
]
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
{
|
|
15
15
|
"name": "@robono/calling-react-native",
|
|
16
16
|
"SPDXID": "SPDXRef-Package",
|
|
17
|
-
"versionInfo": "0.
|
|
17
|
+
"versionInfo": "0.10.0",
|
|
18
18
|
"downloadLocation": "NOASSERTION",
|
|
19
19
|
"filesAnalyzed": true,
|
|
20
20
|
"packageVerificationCode": {
|
|
21
|
-
"packageVerificationCodeValue": "
|
|
21
|
+
"packageVerificationCodeValue": "b6d3cebe85ceea06d48694c5ed669a1f73d4ad7c"
|
|
22
22
|
},
|
|
23
23
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
24
24
|
"licenseDeclared": "LicenseRef-RobonoSDK",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"LicenseRef-RobonoSDK"
|
|
27
27
|
],
|
|
28
28
|
"copyrightText": "Copyright (c) 2026 Add to Loop LLC.",
|
|
29
|
-
"comment": "Host-supplied peers (not bundled): {\"@robono/calling\":\"^0.6.
|
|
29
|
+
"comment": "Host-supplied peers (not bundled): {\"@robono/calling\":\"^0.6.2\",\"react\":\">=18.2 <20\",\"react-native\":\">=0.76 <1\",\"react-native-svg\":\">=15 <16\",\"react-native-safe-area-context\":\">=5 <6\",\"react-native-webrtc\":\">=124 <125\",\"react-native-incall-manager\":\">=4.2 <5\",\"expo-audio\":\">=1.1.1 <2 || >=55 <57\",\"expo-crypto\":\">=15.0.9 <16 || >=55 <57\",\"expo-notifications\":\">=0.32.17 <0.33 || >=55 <57\",\"expo-asset\":\">=12 <13 || >=55 <57\"}"
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"files": [
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
"checksums": [
|
|
94
94
|
{
|
|
95
95
|
"algorithm": "SHA256",
|
|
96
|
-
"checksumValue": "
|
|
96
|
+
"checksumValue": "1ebb385fcc01f891e5678cad5c5343d7fa7cc32f66fe992776e2b526d94b19f0"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"algorithm": "SHA1",
|
|
100
|
-
"checksumValue": "
|
|
100
|
+
"checksumValue": "ec8bd8b69372828e9272b88c35a4093b9593301c"
|
|
101
101
|
}
|
|
102
102
|
],
|
|
103
103
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -5185,11 +5185,11 @@
|
|
|
5185
5185
|
"checksums": [
|
|
5186
5186
|
{
|
|
5187
5187
|
"algorithm": "SHA256",
|
|
5188
|
-
"checksumValue": "
|
|
5188
|
+
"checksumValue": "575919457878555ac08c71a782ebd1b53b199c416e5ad2b323c26ad121fdf053"
|
|
5189
5189
|
},
|
|
5190
5190
|
{
|
|
5191
5191
|
"algorithm": "SHA1",
|
|
5192
|
-
"checksumValue": "
|
|
5192
|
+
"checksumValue": "599db2758445a5ae20d37d36979f85cba427481e"
|
|
5193
5193
|
}
|
|
5194
5194
|
],
|
|
5195
5195
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -5204,11 +5204,11 @@
|
|
|
5204
5204
|
"checksums": [
|
|
5205
5205
|
{
|
|
5206
5206
|
"algorithm": "SHA256",
|
|
5207
|
-
"checksumValue": "
|
|
5207
|
+
"checksumValue": "454365fe1b52828bc4b87e89128a9e8811d16160e4f3c1ef8e5154ec6426869c"
|
|
5208
5208
|
},
|
|
5209
5209
|
{
|
|
5210
5210
|
"algorithm": "SHA1",
|
|
5211
|
-
"checksumValue": "
|
|
5211
|
+
"checksumValue": "efe2cb80dee89a8da603deb5961ffbbada189127"
|
|
5212
5212
|
}
|
|
5213
5213
|
],
|
|
5214
5214
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -5375,11 +5375,11 @@
|
|
|
5375
5375
|
"checksums": [
|
|
5376
5376
|
{
|
|
5377
5377
|
"algorithm": "SHA256",
|
|
5378
|
-
"checksumValue": "
|
|
5378
|
+
"checksumValue": "d66d73aed7644c7153eef21f980921645cfaa0f30747fe08f3bc4f44ae818ed1"
|
|
5379
5379
|
},
|
|
5380
5380
|
{
|
|
5381
5381
|
"algorithm": "SHA1",
|
|
5382
|
-
"checksumValue": "
|
|
5382
|
+
"checksumValue": "e4e05ff09bf98ba7ddd7772b02f60457c530b9cd"
|
|
5383
5383
|
}
|
|
5384
5384
|
],
|
|
5385
5385
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -5394,11 +5394,11 @@
|
|
|
5394
5394
|
"checksums": [
|
|
5395
5395
|
{
|
|
5396
5396
|
"algorithm": "SHA256",
|
|
5397
|
-
"checksumValue": "
|
|
5397
|
+
"checksumValue": "98d5f2cf6abf2d4fefc47f0dcf53a12c5961c99d1e6db6f26a8c10184d229ad3"
|
|
5398
5398
|
},
|
|
5399
5399
|
{
|
|
5400
5400
|
"algorithm": "SHA1",
|
|
5401
|
-
"checksumValue": "
|
|
5401
|
+
"checksumValue": "7b035618a2920fbf09d9eb958efd2e8b03f80a6b"
|
|
5402
5402
|
}
|
|
5403
5403
|
],
|
|
5404
5404
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -5565,11 +5565,11 @@
|
|
|
5565
5565
|
"checksums": [
|
|
5566
5566
|
{
|
|
5567
5567
|
"algorithm": "SHA256",
|
|
5568
|
-
"checksumValue": "
|
|
5568
|
+
"checksumValue": "655e80a5c1dab83434c009e7b364a99dc49ef5180fde32470b07d2ddc647e27d"
|
|
5569
5569
|
},
|
|
5570
5570
|
{
|
|
5571
5571
|
"algorithm": "SHA1",
|
|
5572
|
-
"checksumValue": "
|
|
5572
|
+
"checksumValue": "2c1890297f58cbbe478127f91d4084923ebfa08a"
|
|
5573
5573
|
}
|
|
5574
5574
|
],
|
|
5575
5575
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -5584,11 +5584,11 @@
|
|
|
5584
5584
|
"checksums": [
|
|
5585
5585
|
{
|
|
5586
5586
|
"algorithm": "SHA256",
|
|
5587
|
-
"checksumValue": "
|
|
5587
|
+
"checksumValue": "d6e82a95ce9c89376c32899fc0f67e328c9499cba125fd178ddee632af24dd89"
|
|
5588
5588
|
},
|
|
5589
5589
|
{
|
|
5590
5590
|
"algorithm": "SHA1",
|
|
5591
|
-
"checksumValue": "
|
|
5591
|
+
"checksumValue": "a9f7feb63f3be585146482737dd10f27ce6da4a4"
|
|
5592
5592
|
}
|
|
5593
5593
|
],
|
|
5594
5594
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -5850,11 +5850,11 @@
|
|
|
5850
5850
|
"checksums": [
|
|
5851
5851
|
{
|
|
5852
5852
|
"algorithm": "SHA256",
|
|
5853
|
-
"checksumValue": "
|
|
5853
|
+
"checksumValue": "7179865226ac0382c1b261977dd7a14975b54d79f6ed64c69bf58e377bce4a5c"
|
|
5854
5854
|
},
|
|
5855
5855
|
{
|
|
5856
5856
|
"algorithm": "SHA1",
|
|
5857
|
-
"checksumValue": "
|
|
5857
|
+
"checksumValue": "f8a59d8981ce5d1ce7115f52ccc8eabca003a6ac"
|
|
5858
5858
|
}
|
|
5859
5859
|
],
|
|
5860
5860
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -6116,11 +6116,11 @@
|
|
|
6116
6116
|
"checksums": [
|
|
6117
6117
|
{
|
|
6118
6118
|
"algorithm": "SHA256",
|
|
6119
|
-
"checksumValue": "
|
|
6119
|
+
"checksumValue": "f0ebc12589b1a86bd1fd83c8f5f6a2d044c817ce4237db83ec8598667061bf9c"
|
|
6120
6120
|
},
|
|
6121
6121
|
{
|
|
6122
6122
|
"algorithm": "SHA1",
|
|
6123
|
-
"checksumValue": "
|
|
6123
|
+
"checksumValue": "46e3512c0351cef74846324b1a18835823af2c65"
|
|
6124
6124
|
}
|
|
6125
6125
|
],
|
|
6126
6126
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -6211,11 +6211,11 @@
|
|
|
6211
6211
|
"checksums": [
|
|
6212
6212
|
{
|
|
6213
6213
|
"algorithm": "SHA256",
|
|
6214
|
-
"checksumValue": "
|
|
6214
|
+
"checksumValue": "b804bcb068b37a743f81696f00c2c4df37f8eb741992bb1ce45a868559201b86"
|
|
6215
6215
|
},
|
|
6216
6216
|
{
|
|
6217
6217
|
"algorithm": "SHA1",
|
|
6218
|
-
"checksumValue": "
|
|
6218
|
+
"checksumValue": "bd9b5a4b7127373352243d8f4bd2b04a33a0805e"
|
|
6219
6219
|
}
|
|
6220
6220
|
],
|
|
6221
6221
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -6230,11 +6230,11 @@
|
|
|
6230
6230
|
"checksums": [
|
|
6231
6231
|
{
|
|
6232
6232
|
"algorithm": "SHA256",
|
|
6233
|
-
"checksumValue": "
|
|
6233
|
+
"checksumValue": "a451c4c23c241eff445fc19d0ea7cedb42439a7584519247afafd36d8b8a02db"
|
|
6234
6234
|
},
|
|
6235
6235
|
{
|
|
6236
6236
|
"algorithm": "SHA1",
|
|
6237
|
-
"checksumValue": "
|
|
6237
|
+
"checksumValue": "2fac37dfa3cd3f631abbc0256f1b7a9b1e2512fe"
|
|
6238
6238
|
}
|
|
6239
6239
|
],
|
|
6240
6240
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -6363,11 +6363,11 @@
|
|
|
6363
6363
|
"checksums": [
|
|
6364
6364
|
{
|
|
6365
6365
|
"algorithm": "SHA256",
|
|
6366
|
-
"checksumValue": "
|
|
6366
|
+
"checksumValue": "0bef3fdfd1f112b71f02557491a8f83ccfe99d28e2692671707154dd8b9a4107"
|
|
6367
6367
|
},
|
|
6368
6368
|
{
|
|
6369
6369
|
"algorithm": "SHA1",
|
|
6370
|
-
"checksumValue": "
|
|
6370
|
+
"checksumValue": "eec906d47cdff41a29c4dbc5020f12fef7ef543e"
|
|
6371
6371
|
}
|
|
6372
6372
|
],
|
|
6373
6373
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -6439,11 +6439,11 @@
|
|
|
6439
6439
|
"checksums": [
|
|
6440
6440
|
{
|
|
6441
6441
|
"algorithm": "SHA256",
|
|
6442
|
-
"checksumValue": "
|
|
6442
|
+
"checksumValue": "b65712481dca29727065825984229c566a96f8bbd779aac1f46c8cac4e2ab991"
|
|
6443
6443
|
},
|
|
6444
6444
|
{
|
|
6445
6445
|
"algorithm": "SHA1",
|
|
6446
|
-
"checksumValue": "
|
|
6446
|
+
"checksumValue": "70c2f448b8bc3c71b6c4a443d5eff93de130938c"
|
|
6447
6447
|
}
|
|
6448
6448
|
],
|
|
6449
6449
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -6496,11 +6496,11 @@
|
|
|
6496
6496
|
"checksums": [
|
|
6497
6497
|
{
|
|
6498
6498
|
"algorithm": "SHA256",
|
|
6499
|
-
"checksumValue": "
|
|
6499
|
+
"checksumValue": "32bc41a29950ad9c4a61c602d2469a937394d941ffd10f154ffcbdd84a764009"
|
|
6500
6500
|
},
|
|
6501
6501
|
{
|
|
6502
6502
|
"algorithm": "SHA1",
|
|
6503
|
-
"checksumValue": "
|
|
6503
|
+
"checksumValue": "9a6d8e8011028022dc54ec99babb581b531630db"
|
|
6504
6504
|
}
|
|
6505
6505
|
],
|
|
6506
6506
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
|
@@ -6591,11 +6591,11 @@
|
|
|
6591
6591
|
"checksums": [
|
|
6592
6592
|
{
|
|
6593
6593
|
"algorithm": "SHA256",
|
|
6594
|
-
"checksumValue": "
|
|
6594
|
+
"checksumValue": "3b1e2c61b3dbc9ac0a6627e8bf090e0442d7e4e082958886600888655904dfe2"
|
|
6595
6595
|
},
|
|
6596
6596
|
{
|
|
6597
6597
|
"algorithm": "SHA1",
|
|
6598
|
-
"checksumValue": "
|
|
6598
|
+
"checksumValue": "2ca63a8877dcef5b508d93b47adbc0518589d100"
|
|
6599
6599
|
}
|
|
6600
6600
|
],
|
|
6601
6601
|
"licenseConcluded": "LicenseRef-RobonoSDK",
|
package/dist/appearance.d.ts
CHANGED
|
@@ -20,7 +20,10 @@ export declare const callingLightColors: {
|
|
|
20
20
|
};
|
|
21
21
|
export interface CallingPresentation {
|
|
22
22
|
colorMode: "dark" | "light" | "system";
|
|
23
|
-
font: "system" | "serif" | "monospace";
|
|
23
|
+
font: "system" | "sans" | "humanist" | "condensed" | "serif" | "monospace";
|
|
24
|
+
bold?: boolean;
|
|
25
|
+
italic?: boolean;
|
|
26
|
+
underline?: boolean;
|
|
24
27
|
textScale: 1 | 1.15 | 1.3;
|
|
25
28
|
layout: "standard" | "compact";
|
|
26
29
|
controlShape: "round" | "rounded";
|
|
@@ -75,7 +78,18 @@ export declare const soundCatalog: {
|
|
|
75
78
|
export declare const callingSounds: Record<SoundEvent, SoundChoice>;
|
|
76
79
|
export type SoundChoice = keyof typeof soundCatalog;
|
|
77
80
|
export type SoundEvent = "incoming" | "outgoing" | "connecting" | "connected" | "ended" | "declined" | "unanswered" | "held" | "resumed";
|
|
81
|
+
export declare const callingScreenNames: readonly ["voice", "video", "groupVoice", "groupVideo"];
|
|
82
|
+
export type CallingStyleScreen = typeof callingScreenNames[number];
|
|
83
|
+
export type CallingScreenStyle = {
|
|
84
|
+
theme?: Partial<typeof callingColors>;
|
|
85
|
+
lightTheme?: Partial<typeof callingColors>;
|
|
86
|
+
presentation?: Partial<CallingPresentation>;
|
|
87
|
+
labels?: Partial<typeof callingText>;
|
|
88
|
+
};
|
|
89
|
+
export declare function callingStyleScreen(kind?: 'voice' | 'video', group?: boolean): CallingStyleScreen;
|
|
90
|
+
export declare function callingScreenAppearance(a: CallingAppearance, screen: CallingStyleScreen): CallingAppearance;
|
|
78
91
|
export interface CallingAppearance {
|
|
92
|
+
screenStyles?: Partial<Record<CallingStyleScreen, CallingScreenStyle>>;
|
|
79
93
|
schemaVersion: 1;
|
|
80
94
|
appName: string;
|
|
81
95
|
logoUrl: string | null;
|
|
@@ -92,7 +106,10 @@ export declare function validateCallingAppearance(input: unknown): CallingAppear
|
|
|
92
106
|
export declare function resolveCallingDesign(appearance?: CallingAppearance, deviceMode?: "light" | "dark" | "unspecified" | null): {
|
|
93
107
|
presentation: {
|
|
94
108
|
colorMode: "dark" | "light" | "system";
|
|
95
|
-
font: "system" | "serif" | "monospace";
|
|
109
|
+
font: "system" | "sans" | "humanist" | "condensed" | "serif" | "monospace";
|
|
110
|
+
bold?: boolean;
|
|
111
|
+
italic?: boolean;
|
|
112
|
+
underline?: boolean;
|
|
96
113
|
textScale: 1 | 1.15 | 1.3;
|
|
97
114
|
layout: "standard" | "compact";
|
|
98
115
|
controlShape: "round" | "rounded";
|
|
@@ -114,7 +131,7 @@ export declare function resolveCallingDesign(appearance?: CallingAppearance, dev
|
|
|
114
131
|
controlRadius: number;
|
|
115
132
|
fontFamily: {
|
|
116
133
|
ios: string | undefined;
|
|
117
|
-
android:
|
|
134
|
+
android: string | undefined;
|
|
118
135
|
web: string;
|
|
119
136
|
};
|
|
120
137
|
};
|
package/dist/appearance.js
CHANGED
|
@@ -71,6 +71,9 @@ export const callingSounds = {
|
|
|
71
71
|
held: "none",
|
|
72
72
|
resumed: "none",
|
|
73
73
|
};
|
|
74
|
+
export const callingScreenNames = ['voice', 'video', 'groupVoice', 'groupVideo'];
|
|
75
|
+
export function callingStyleScreen(kind, group = false) { return group ? (kind === 'video' ? 'groupVideo' : 'groupVoice') : (kind === 'video' ? 'video' : 'voice'); }
|
|
76
|
+
export function callingScreenAppearance(a, screen) { const own = a.screenStyles?.[screen]; return { ...a, theme: { ...a.theme, ...own?.theme }, lightTheme: { ...callingLightColors, ...a.lightTheme, ...own?.lightTheme }, presentation: { ...a.presentation, ...own?.presentation }, labels: { ...a.labels, ...own?.labels } }; }
|
|
74
77
|
export function defaultCallingAppearance(appName = "") {
|
|
75
78
|
return {
|
|
76
79
|
schemaVersion: 1,
|
|
@@ -116,7 +119,7 @@ export function validateCallingAppearance(input) {
|
|
|
116
119
|
throw Error("Choose valid screen appearance settings.");
|
|
117
120
|
}
|
|
118
121
|
const choices = {
|
|
119
|
-
colorMode: ["dark", "light", "system"], font: ["system", "serif", "monospace"],
|
|
122
|
+
colorMode: ["dark", "light", "system"], font: ["system", "sans", "humanist", "condensed", "serif", "monospace"], bold: [true, false], italic: [true, false], underline: [true, false],
|
|
120
123
|
textScale: [1, 1.15, 1.3], layout: ["standard", "compact"],
|
|
121
124
|
controlShape: ["round", "rounded"], showAvatar: [true, false],
|
|
122
125
|
showCallDescription: [true, false],
|
|
@@ -157,6 +160,28 @@ export function validateCallingAppearance(input) {
|
|
|
157
160
|
}
|
|
158
161
|
out.sounds[key] = v.sounds[key];
|
|
159
162
|
}
|
|
163
|
+
if (v.screenStyles !== undefined) {
|
|
164
|
+
if (!v.screenStyles || typeof v.screenStyles !== 'object' || Array.isArray(v.screenStyles))
|
|
165
|
+
throw Error('Choose valid call screen styles.');
|
|
166
|
+
out.screenStyles = {};
|
|
167
|
+
for (const key of callingScreenNames) {
|
|
168
|
+
const own = v.screenStyles[key];
|
|
169
|
+
if (own === undefined)
|
|
170
|
+
continue;
|
|
171
|
+
if (!own || typeof own !== 'object' || Array.isArray(own))
|
|
172
|
+
throw Error('Choose valid call screen styles.');
|
|
173
|
+
const checked = validateCallingAppearance({ ...callingScreenAppearance({ ...out, screenStyles: { [key]: own } }, key), screenStyles: undefined });
|
|
174
|
+
const style = {};
|
|
175
|
+
for (const field of ['theme', 'lightTheme', 'presentation', 'labels']) {
|
|
176
|
+
if (own[field] !== undefined) {
|
|
177
|
+
if (!own[field] || typeof own[field] !== 'object' || Array.isArray(own[field]))
|
|
178
|
+
throw Error('Choose valid call screen styles.');
|
|
179
|
+
Object.assign(style, { [field]: Object.fromEntries(Object.keys(own[field]).filter(k => Object.hasOwn(checked[field], k)).map(k => [k, checked[field][k]])) });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
out.screenStyles[key] = style;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
160
185
|
return out;
|
|
161
186
|
}
|
|
162
187
|
/** Shared by the optional mobile screen and website preview. */
|
|
@@ -172,9 +197,9 @@ export function resolveCallingDesign(appearance, deviceMode = "dark") {
|
|
|
172
197
|
identityGap: presentation.layout === "compact" ? 10 : 14,
|
|
173
198
|
controlRadius: presentation.controlShape === "rounded" ? 18 : 36,
|
|
174
199
|
fontFamily: {
|
|
175
|
-
ios: presentation.font === "serif" ? "Georgia" : presentation.font === "monospace" ? "Menlo" : undefined,
|
|
176
|
-
android: presentation.font === "system" ? undefined : presentation.font,
|
|
177
|
-
web: presentation.font === "serif" ? 'Georgia, "Times New Roman", serif' : presentation.font === "monospace" ? 'Menlo, Consolas, monospace' : '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
200
|
+
ios: presentation.font === "serif" ? "Georgia" : presentation.font === "monospace" ? "Menlo" : presentation.font === "humanist" ? "Avenir Next" : presentation.font === "condensed" ? "AvenirNextCondensed-Regular" : presentation.font === "sans" ? "Helvetica" : undefined,
|
|
201
|
+
android: presentation.font === "system" ? undefined : presentation.font === "condensed" ? "sans-serif-condensed" : ["sans", "humanist"].includes(presentation.font) ? "sans-serif" : presentation.font,
|
|
202
|
+
web: presentation.font === "serif" ? 'Georgia, "Times New Roman", serif' : presentation.font === "monospace" ? 'Menlo, Consolas, monospace' : presentation.font === 'humanist' ? 'Trebuchet MS, sans-serif' : presentation.font === 'condensed' ? 'Arial Narrow, Liberation Sans Narrow, sans-serif' : presentation.font === 'sans' ? 'Arial, Helvetica, sans-serif' : '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
178
203
|
},
|
|
179
204
|
};
|
|
180
205
|
}
|
package/dist/components.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export interface CallingAvatarProps {
|
|
|
42
42
|
export interface CallingContactProps {
|
|
43
43
|
nameStyle?: StyleProp<TextStyle>;
|
|
44
44
|
descriptionStyle?: StyleProp<TextStyle>;
|
|
45
|
+
compact?: boolean;
|
|
45
46
|
}
|
|
46
47
|
export interface CallingStatusProps {
|
|
47
48
|
style?: StyleProp<TextStyle>;
|
|
@@ -140,7 +141,7 @@ export declare function CallingUIProvider({ children, ...props }: CallingUIProvi
|
|
|
140
141
|
export declare function CallingLayout({ children, style, contentContainerStyle }: CallingLayoutProps): React.JSX.Element;
|
|
141
142
|
export declare function CallingBrand({ style }?: CallingSectionProps): React.JSX.Element | null;
|
|
142
143
|
export declare function CallingAvatar({ size }?: CallingAvatarProps): React.JSX.Element | null;
|
|
143
|
-
export declare function CallingContact({ nameStyle, descriptionStyle }?: CallingContactProps): React.JSX.Element;
|
|
144
|
+
export declare function CallingContact({ nameStyle, descriptionStyle, compact }?: CallingContactProps): React.JSX.Element;
|
|
144
145
|
export declare function CallingStatus({ style, detailStyle }?: CallingStatusProps): React.JSX.Element;
|
|
145
146
|
export declare function CallingIdentity({ style }?: CallingSectionProps): React.JSX.Element;
|
|
146
147
|
/** A state-aware button. Hidden actions render nothing; unavailable actions are disabled. */
|
package/dist/components.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { callingScreenAppearance, callingStyleScreen } from './appearance.js';
|
|
2
3
|
import { createContext, useContext, useEffect, useRef, useState } from 'react';
|
|
3
4
|
import { AppState, Image, Platform, Pressable, ScrollView, StyleSheet, Text, View, useColorScheme } from 'react-native';
|
|
4
5
|
import { RobonoIcon } from './visual/RobonoIcon.js';
|
|
@@ -15,9 +16,9 @@ export function useCallingUI() {
|
|
|
15
16
|
/** Presentation only: does not create a client, request microphone access or own audio. */
|
|
16
17
|
export function CallingUIProvider({ children, ...props }) {
|
|
17
18
|
const safeArea = useContext(SafeAreaInsetsContext);
|
|
18
|
-
const design = resolveCallingDesign(props.appearance, useColorScheme());
|
|
19
|
+
const design = resolveCallingDesign(props.appearance ? callingScreenAppearance(props.appearance, callingStyleScreen(props.state.kind, props.state.group)) : undefined, useColorScheme());
|
|
19
20
|
const c = { ...design.colors, ...props.theme };
|
|
20
|
-
const t = { ...callingText, ...props.appearance
|
|
21
|
+
const t = { ...callingText, ...(props.appearance ? callingScreenAppearance(props.appearance, callingStyleScreen(props.state.kind, props.state.group)).labels : {}), ...props.labels };
|
|
21
22
|
const s = props.state;
|
|
22
23
|
const [clock, setClock] = useState(Date.now());
|
|
23
24
|
useEffect(() => {
|
|
@@ -58,7 +59,7 @@ export function CallingUIProvider({ children, ...props }) {
|
|
|
58
59
|
insets: props.insets || safeArea, components: props.components || {},
|
|
59
60
|
title: s.contact?.name || t.contact,
|
|
60
61
|
status: s.phase === 'connected' ? duration : s.phase === 'error' || s.phase === 'idle' ? '' : s.phase === 'incoming' && s.kind === 'video' ? t.incomingVideo : t[s.phase],
|
|
61
|
-
error, actions, typography: size => ({ fontFamily, fontSize: size * design.presentation.textScale }),
|
|
62
|
+
error, actions, typography: size => ({ fontFamily, fontSize: size * design.presentation.textScale, ...(design.presentation.bold !== undefined ? { fontWeight: design.presentation.bold ? '700' : '400' } : {}), ...(design.presentation.italic !== undefined ? { fontStyle: design.presentation.italic ? 'italic' : 'normal' } : {}), ...(design.presentation.underline !== undefined ? { textDecorationLine: design.presentation.underline ? 'underline' : 'none' } : {}) }),
|
|
62
63
|
};
|
|
63
64
|
return s.phase === 'idle' ? null : _jsx(CallingUIContext.Provider, { value: value, children: children });
|
|
64
65
|
}
|
|
@@ -88,9 +89,9 @@ export function CallingAvatar({ size } = {}) {
|
|
|
88
89
|
? _jsx(Image, { source: { uri: state.contact.avatarUri }, style: [styles.avatar, style], accessibilityIgnoresInvertColors: true })
|
|
89
90
|
: _jsx(View, { style: [styles.avatar, style, { backgroundColor: theme.control }], children: _jsx(Text, { style: [styles.initial, typography(size !== undefined ? size * 44 / 104 : design.presentation.layout === 'compact' ? 30 : 44), { color: theme.accent }], children: title.trim().charAt(0).toUpperCase() }) });
|
|
90
91
|
}
|
|
91
|
-
export function CallingContact({ nameStyle, descriptionStyle } = {}) {
|
|
92
|
+
export function CallingContact({ nameStyle, descriptionStyle, compact } = {}) {
|
|
92
93
|
const { title, labels, theme, design, typography, state } = useCallingUI();
|
|
93
|
-
return _jsxs(_Fragment, { children: [_jsx(Text, { style: [styles.name, typography(28), { color: theme.foreground }, nameStyle], children: title }), design.presentation.showCallDescription && _jsx(Text, { style: [styles.kind, typography(16), { color: theme.secondary }, descriptionStyle], children: state.kind === 'video' ? labels.videoCall : labels.call })] });
|
|
94
|
+
return _jsxs(_Fragment, { children: [_jsx(Text, { numberOfLines: compact ? 1 : undefined, style: [styles.name, typography(28), { color: theme.foreground }, nameStyle], children: title }), !compact && design.presentation.showCallDescription && _jsx(Text, { style: [styles.kind, typography(16), { color: theme.secondary }, descriptionStyle], children: state.kind === 'video' ? labels.videoCall : labels.call })] });
|
|
94
95
|
}
|
|
95
96
|
export function CallingStatus({ style, detailStyle } = {}) {
|
|
96
97
|
const { state, status, error, labels, theme, typography } = useCallingUI();
|
|
@@ -101,7 +102,7 @@ export function CallingIdentity({ style } = {}) {
|
|
|
101
102
|
const Brand = components.Brand || CallingBrand, Avatar = components.Avatar || CallingAvatar;
|
|
102
103
|
const Contact = components.Contact || CallingContact, Status = components.Status || CallingStatus;
|
|
103
104
|
if ((state.kind === 'video' || state.group) && !['incoming', 'error', 'loading'].includes(state.phase))
|
|
104
|
-
return _jsxs(View, {
|
|
105
|
+
return _jsxs(View, { testID: "calling-compact-identity", style: [{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 16, paddingVertical: 4 }, style], children: [_jsx(View, { style: { flex: 1, minWidth: 0 }, children: _jsx(Contact, { compact: true, nameStyle: { fontSize: 18, textAlign: 'left' }, descriptionStyle: { display: 'none' } }) }), _jsx(View, { style: { flexShrink: 0, maxWidth: '50%' }, children: _jsx(Status, { style: { fontSize: 14, marginTop: 0, textAlign: 'right' }, detailStyle: { fontSize: 13, textAlign: 'right' } }) })] });
|
|
105
106
|
return _jsxs(View, { style: [styles.identity, { gap: design.identityGap }, style], children: [_jsx(Brand, {}), _jsx(Avatar, {}), _jsx(Contact, {}), _jsx(Status, {})] });
|
|
106
107
|
}
|
|
107
108
|
function ControlIcon({ name, color, muted }) {
|
|
@@ -130,17 +131,13 @@ export function CallingIncomingControls({ style } = {}) {
|
|
|
130
131
|
return null;
|
|
131
132
|
return _jsxs(View, { style: [styles.row, style], children: [_jsx(Button, { action: "decline" }), _jsx(Button, { action: "answer" })] });
|
|
132
133
|
}
|
|
133
|
-
/**
|
|
134
|
+
/** Every available call action is visible without opening an overflow menu. */
|
|
134
135
|
function CallingConferenceControls({ style }) {
|
|
135
|
-
const { actions, components,
|
|
136
|
+
const { actions, components, typography } = useCallingUI();
|
|
136
137
|
const Button = components.ActionButton || CallingActionButton;
|
|
137
|
-
const [
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
const icon = { width: 48, height: 48 };
|
|
141
|
-
const label = typography(12);
|
|
142
|
-
useEffect(() => { setExpanded(false); }, [state.phase]);
|
|
143
|
-
return _jsxs(View, { style: [{ position: 'relative', zIndex: 2, paddingVertical: 8 }, style], children: [expanded && _jsxs(View, { testID: "calling-more-tools", style: { marginBottom: 12, width: '100%', maxWidth: 420, alignSelf: 'center', borderRadius: 18, padding: 16, backgroundColor: theme.control }, children: [_jsx(View, { style: { flexDirection: 'row', justifyContent: 'space-evenly', gap: 12 }, children: secondary.map(action => _jsx(Button, { action: action, style: compact, iconStyle: icon, labelStyle: label }, action)) }), _jsx(CallingBackgroundControl, {}), _jsx(CallingConnectionDetails, {})] }), _jsxs(View, { testID: "calling-main-controls", style: { flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'center', gap: 12, maxWidth: 420, width: '100%', alignSelf: 'center' }, children: [_jsx(Button, { action: "mute", style: compact, iconStyle: icon, labelStyle: label }), actions.camera.visible && _jsx(Button, { action: "camera", style: compact, iconStyle: icon, labelStyle: label }), state.kind !== 'video' && _jsx(Button, { action: "speaker", style: compact, iconStyle: icon, labelStyle: label }), (secondary.length > 0 || getDiagnostics && diagnostics !== false && state.phase === 'connected') && _jsxs(Pressable, { accessibilityRole: "button", accessibilityLabel: labels.more, accessibilityState: { expanded }, onPress: () => setExpanded(value => !value), style: [styles.button, compact], children: [_jsx(View, { style: [styles.circle, icon, { borderRadius: design.controlRadius, backgroundColor: expanded ? theme.foreground : theme.control }], children: _jsx(RobonoIcon, { name: "more", size: 24, color: expanded ? theme.background : theme.foreground }) }), _jsx(Text, { style: [label, { color: theme.foreground, textAlign: 'center' }], children: labels.more })] }), _jsx(Button, { action: "end", style: [compact, { marginLeft: 8 }], iconStyle: icon, labelStyle: label })] })] });
|
|
138
|
+
const [width, setWidth] = useState(0);
|
|
139
|
+
const visible = ['mute', 'speaker', 'camera', 'flip', 'share', 'end'].filter(action => actions[action].visible);
|
|
140
|
+
return _jsxs(View, { style: [{ paddingVertical: 4, gap: 4 }, style], children: [_jsx(View, { testID: "calling-main-controls", onLayout: e => setWidth(e.nativeEvent.layout.width), style: { flexDirection: 'row', flexWrap: 'wrap', alignItems: 'flex-start', justifyContent: 'center', gap: 8, width: '100%', maxWidth: 560, alignSelf: 'center' }, children: visible.map(action => _jsx(Button, { action: action, style: { flexGrow: 1, flexBasis: width > 0 && width < 336 && visible.length > 4 ? '28%' : 48, minWidth: 48, maxWidth: 88, gap: 4 }, iconStyle: { width: 44, height: 44 }, labelStyle: typography(12) }, action)) }), _jsx(CallingBackgroundControl, {}), _jsx(CallingConnectionDetails, {})] });
|
|
144
141
|
}
|
|
145
142
|
export function CallingControls({ style } = {}) {
|
|
146
143
|
const { actions, components, state } = useCallingUI();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type TextProps } from 'react-native';
|
|
2
3
|
import type { CallDeviceCheck } from './device-check.js';
|
|
3
4
|
export declare const callDeviceCheckText: {
|
|
4
5
|
deviceError: string;
|
|
@@ -14,9 +15,15 @@ export declare const callDeviceCheckText: {
|
|
|
14
15
|
private: string;
|
|
15
16
|
retry: string;
|
|
16
17
|
};
|
|
17
|
-
export declare function CallDeviceCheckPanel({ check, renderVideo, accent, labels }: {
|
|
18
|
+
export declare function CallDeviceCheckPanel({ check, renderVideo, accent, labels, colors, TextComponent: Text }: {
|
|
18
19
|
check: CallDeviceCheck;
|
|
20
|
+
TextComponent?: React.ComponentType<TextProps>;
|
|
19
21
|
renderVideo?: (stream: MediaStream) => React.ReactNode;
|
|
20
22
|
accent?: string;
|
|
21
23
|
labels?: Partial<typeof callDeviceCheckText>;
|
|
24
|
+
colors?: {
|
|
25
|
+
foreground: string;
|
|
26
|
+
secondary: string;
|
|
27
|
+
controls: string;
|
|
28
|
+
};
|
|
22
29
|
}): React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useSyncExternalStore } from 'react';
|
|
3
|
-
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { Pressable, Text as NativeText, View } from 'react-native';
|
|
4
4
|
export const callDeviceCheckText = { deviceError: 'Allow microphone and camera access in your device settings, then try again.', soundError: 'Sound could not play. Check your volume and selected headphones or speaker.', microphone: 'Microphone', speak: 'Speak to see the microphone level.', unavailable: 'Your device does not report a microphone level.', opening: 'Opening your devices…', audio: 'Check microphone', video: 'Check camera too', speaker: 'Play test sound', heard: 'Did you hear the sound? Check your volume or headphones if not.', private: 'This check stays on your device. Nothing is sent or saved.', retry: 'Try again' };
|
|
5
|
-
export function CallDeviceCheckPanel({ check, renderVideo, accent = '#FF8A2C', labels = {} }) {
|
|
5
|
+
export function CallDeviceCheckPanel({ check, renderVideo, accent = '#FF8A2C', labels = {}, colors = { foreground: '#fff', secondary: '#aaa', controls: '#242424' }, TextComponent: Text = NativeText }) {
|
|
6
6
|
const state = useSyncExternalStore(check.subscribe, check.getSnapshot, check.getSnapshot), text = { ...callDeviceCheckText, ...labels };
|
|
7
|
-
const button = (label, action) => _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: label, disabled: state.phase === 'opening', onPress: () => void action().catch(() => { }), style: { minHeight: 44, borderRadius: 12, backgroundColor:
|
|
8
|
-
return _jsxs(View, { testID: "calling-device-check", style: { gap: 16 }, children: [_jsx(Text, { style: { color:
|
|
7
|
+
const button = (label, action) => _jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: label, disabled: state.phase === 'opening', onPress: () => void action().catch(() => { }), style: { minHeight: 44, borderRadius: 12, backgroundColor: colors.controls, paddingHorizontal: 16, justifyContent: 'center', opacity: state.phase === 'opening' ? .5 : 1 }, children: _jsx(Text, { style: { fontSize: 16, color: accent, fontWeight: '600' }, children: label }) }, label);
|
|
8
|
+
return _jsxs(View, { testID: "calling-device-check", style: { gap: 16 }, children: [_jsx(Text, { style: { color: colors.secondary, fontSize: 15 }, children: text.private }), _jsxs(View, { style: { flexDirection: 'row', flexWrap: 'wrap', gap: 8 }, children: [button(text.audio, () => check.start('voice')), button(text.video, () => check.start('video'))] }), state.phase === 'opening' && _jsx(Text, { accessibilityLiveRegion: "polite", style: { color: colors.foreground, fontSize: 16 }, children: text.opening }), state.stream && state.kind === 'video' && renderVideo && _jsx(View, { style: { height: 240, overflow: 'hidden', borderRadius: 14, backgroundColor: '#151515' }, children: renderVideo(state.stream) }), state.phase === 'ready' && _jsxs(_Fragment, { children: [_jsx(Text, { style: { color: colors.foreground, fontSize: 17, fontWeight: '600' }, children: text.microphone }), _jsx(View, { accessibilityRole: "progressbar", accessibilityLabel: text.microphone, accessibilityValue: { min: 0, max: 100, now: Math.round((state.level ?? 0) * 100) }, style: { height: 12, borderRadius: 6, overflow: 'hidden', backgroundColor: '#333' }, children: _jsx(View, { style: { height: 12, width: `${Math.round(Math.sqrt(state.level ?? 0) * 100)}%`, backgroundColor: accent } }) }), _jsx(Text, { style: { color: colors.secondary, fontSize: 15 }, children: state.level === null ? text.unavailable : text.speak }), button(text.speaker, () => check.speaker()), state.heard && _jsx(Text, { style: { color: colors.secondary, fontSize: 15 }, children: text.heard })] }), state.error && _jsx(Text, { accessibilityRole: "alert", style: { color: colors.foreground, fontSize: 16 }, children: state.phase === 'error' ? text.deviceError : text.soundError })] });
|
|
9
9
|
}
|
package/dist/messenger.js
CHANGED
|
@@ -7,16 +7,35 @@ import { parseCallingNotification } from './notifications.js';
|
|
|
7
7
|
export function createMessengerCalling(options) {
|
|
8
8
|
let state = { direct: null, group: null, features: { voice: false, video: false }, loading: false, error: '' };
|
|
9
9
|
let closed = false, pending = null, transport, timer;
|
|
10
|
+
let recoveryTimer, stableTimer, recoveryFailures = 0;
|
|
10
11
|
let adapters = [], detach = [];
|
|
11
12
|
const dismissed = new Set();
|
|
12
13
|
const listeners = new Set();
|
|
13
14
|
const emit = (patch) => { state = { ...state, ...patch }; listeners.forEach(fn => fn()); };
|
|
14
15
|
const active = () => [state.direct, state.group].some(c => c && !['idle', 'error'].includes(c.getSnapshot().phase));
|
|
15
16
|
const deviceCheck = options.deviceCheck?.(active);
|
|
16
|
-
const
|
|
17
|
-
|
|
17
|
+
const recover = (status) => {
|
|
18
|
+
if (closed || status === 403 || recoveryTimer || recoveryFailures >= 6)
|
|
19
|
+
return;
|
|
20
|
+
clearTimeout(stableTimer);
|
|
21
|
+
const delay = Math.min(60000, 1000 * 2 ** recoveryFailures++);
|
|
22
|
+
emit({ error: 'Reconnecting calls…' });
|
|
23
|
+
const attempt = () => { recoveryTimer = undefined; if (closed)
|
|
24
|
+
return; if (active()) {
|
|
25
|
+
recoveryTimer = setTimeout(attempt, 15000);
|
|
26
|
+
return;
|
|
27
|
+
} void start().catch(() => { }); };
|
|
28
|
+
recoveryTimer = setTimeout(attempt, delay);
|
|
29
|
+
};
|
|
30
|
+
const watchCheck = (controller) => controller.subscribe(() => {
|
|
31
|
+
if (deviceCheck?.getSnapshot().phase !== 'idle' && active())
|
|
32
|
+
void deviceCheck?.close();
|
|
33
|
+
if (controller.client.closed && controller.client.state?.listeningStatus === 'session_expired')
|
|
34
|
+
recover(401);
|
|
35
|
+
});
|
|
18
36
|
const release = async () => {
|
|
19
37
|
clearTimeout(timer);
|
|
38
|
+
clearTimeout(stableTimer);
|
|
20
39
|
const controllers = [state.direct, state.group], old = transport, owned = adapters;
|
|
21
40
|
transport = undefined;
|
|
22
41
|
adapters = [];
|
|
@@ -46,6 +65,8 @@ export function createMessengerCalling(options) {
|
|
|
46
65
|
return pending;
|
|
47
66
|
if (transport && Date.now() < transport.expiresAt && !state.direct?.client.closed && !state.group?.client.closed)
|
|
48
67
|
return Promise.resolve();
|
|
68
|
+
clearTimeout(recoveryTimer);
|
|
69
|
+
recoveryTimer = undefined;
|
|
49
70
|
emit({ loading: true, error: '' });
|
|
50
71
|
pending = (async () => {
|
|
51
72
|
await release();
|
|
@@ -82,10 +103,16 @@ export function createMessengerCalling(options) {
|
|
|
82
103
|
await release();
|
|
83
104
|
return;
|
|
84
105
|
}
|
|
106
|
+
const failed = [state.direct, state.group].find(c => c?.client.closed);
|
|
107
|
+
if (failed)
|
|
108
|
+
throw Object.assign(Error('Calling session could not connect.'), { status: failed.client.state?.listeningStatus === 'access_revoked' ? 403 : 401 });
|
|
85
109
|
emit({ loading: false, error: '' });
|
|
110
|
+
stableTimer = setTimeout(() => { recoveryFailures = 0; }, 60000);
|
|
86
111
|
renew();
|
|
87
|
-
})().catch(async (error) => { await release(); if (!closed)
|
|
88
|
-
emit({ loading: false, error:
|
|
112
|
+
})().catch(async (error) => { await release(); if (!closed) {
|
|
113
|
+
emit({ loading: false, error: error?.status === 403 ? 'Calling is no longer allowed.' : 'Calling is temporarily unavailable.' });
|
|
114
|
+
recover(error?.status);
|
|
115
|
+
} throw error; }).finally(() => { pending = null; });
|
|
89
116
|
return pending;
|
|
90
117
|
};
|
|
91
118
|
return {
|
|
@@ -133,6 +160,6 @@ export function createMessengerCalling(options) {
|
|
|
133
160
|
await state.direct.call(conversationId, undefined, { kind });
|
|
134
161
|
},
|
|
135
162
|
async dispose() { if (closed)
|
|
136
|
-
return; closed = true; clearTimeout(timer); await deviceCheck?.dispose(); await pending?.catch(() => { }); await release(); listeners.clear(); },
|
|
163
|
+
return; closed = true; clearTimeout(timer); clearTimeout(recoveryTimer); clearTimeout(stableTimer); await deviceCheck?.dispose(); await pending?.catch(() => { }); await release(); listeners.clear(); },
|
|
137
164
|
};
|
|
138
165
|
}
|
package/dist/screens.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { callingScreenAppearance, callingStyleScreen } from './appearance.js';
|
|
2
3
|
import { useEffect, useSyncExternalStore } from 'react';
|
|
3
4
|
import { AppState, Modal, StatusBar, useColorScheme } from 'react-native';
|
|
4
5
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
@@ -23,7 +24,7 @@ export function useCalling(controller) {
|
|
|
23
24
|
/** Mount only when you choose Robono's interface. No global navigation changes. */
|
|
24
25
|
export function CallingOverlay({ controller, ...props }) {
|
|
25
26
|
const state = useCalling(controller);
|
|
26
|
-
const design = resolveCallingDesign(props.appearance, useColorScheme());
|
|
27
|
+
const design = resolveCallingDesign(props.appearance ? callingScreenAppearance(props.appearance, callingStyleScreen(state.kind, state.group)) : undefined, useColorScheme());
|
|
27
28
|
useEffect(() => { controller.reportComponents?.(['screens']); }, [controller]);
|
|
28
29
|
useEffect(() => {
|
|
29
30
|
controller.setForeground(AppState.currentState === 'active');
|
package/dist/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const mobileVersion = "0.
|
|
2
|
-
export declare const engineVersion = "0.6.
|
|
1
|
+
export declare const mobileVersion = "0.10.0";
|
|
2
|
+
export declare const engineVersion = "0.6.3";
|
package/dist/versions.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Generated from the package manifests by build.mjs.
|
|
2
|
-
export const mobileVersion = "0.
|
|
3
|
-
export const engineVersion = "0.6.
|
|
2
|
+
export const mobileVersion = "0.10.0";
|
|
3
|
+
export const engineVersion = "0.6.3";
|
package/examples/CallingHost.tsx
CHANGED
|
@@ -14,7 +14,7 @@ export interface CallingHostProps {
|
|
|
14
14
|
/** Optional component replacements; the same host still owns session and audio. */
|
|
15
15
|
components?: CallingScreenComponents;
|
|
16
16
|
/** Your authenticated backend returns a session for THIS signed-in account. */
|
|
17
|
-
getSession(): Promise<{serviceUrl: string; token: string; expiresAt: number; appearance?:unknown; appearanceRevision?:number}>;
|
|
17
|
+
getSession(): Promise<{serviceUrl: string; token: string; eventsToken?: string; expiresAt: number; appearance?:unknown; appearanceRevision?:number}>;
|
|
18
18
|
/** Supply the HTTPS service origin configured for your integration. */
|
|
19
19
|
serviceOrigin: string;
|
|
20
20
|
connectionId: string;
|
|
@@ -100,7 +100,7 @@ function AccountCallingHost(props: CallingHostProps & {cleanup: React.MutableRef
|
|
|
100
100
|
restoreAudio:() => setAudioModeAsync({allowsRecording:false,playsInSilentMode:true,
|
|
101
101
|
interruptionMode:'duckOthers',shouldPlayInBackground:false,shouldRouteThroughEarpiece:false}),
|
|
102
102
|
});
|
|
103
|
-
instance = createCallingController({request:createHttpTransport({baseUrl:session.serviceUrl,token:session.token}),
|
|
103
|
+
instance = createCallingController({request:createHttpTransport({baseUrl:session.serviceUrl,token:session.token,eventsToken:session.eventsToken}),
|
|
104
104
|
...adapters, appearanceRevision:session.appearanceRevision, resolveContact:props.resolveContact,
|
|
105
105
|
onError:() => { if (!cancelled) setError('The call could not connect. Please try again.'); }});
|
|
106
106
|
instance.setForeground(AppState.currentState === 'active');
|
|
@@ -10,7 +10,7 @@ import {createNativeCallAdapters} from '@robono/calling-react-native/native';
|
|
|
10
10
|
import {createNativeCallRuntime} from '@robono/calling-react-native/runtime';
|
|
11
11
|
export interface GroupCallingHostProps{
|
|
12
12
|
accountId:string;serviceOrigin:string;connectionId:string;kind:'voice'|'video';
|
|
13
|
-
getSession():Promise<{serviceUrl:string;token:string;expiresAt:number;appearance?:unknown;appearanceRevision?:number}>;
|
|
13
|
+
getSession():Promise<{serviceUrl:string;token:string;eventsToken?:string;expiresAt:number;appearance?:unknown;appearanceRevision?:number}>;
|
|
14
14
|
resolveGroup(id:string):Contact|null;resolveMember(appId:string,userId:string):Contact|null;
|
|
15
15
|
notificationCallId?:string;onNotificationConsumed?(id:string):void;
|
|
16
16
|
onController?(controller:GroupCallingController|null):void;
|
|
@@ -42,7 +42,7 @@ function AccountHost(props:GroupCallingHostProps&{cleanup:React.MutableRefObject
|
|
|
42
42
|
const design=session.appearance===undefined?undefined:validateCallingAppearance(session.appearance);setAppearance(design);
|
|
43
43
|
runtime=createNativeCallRuntime({notificationTitle:'Group call',notificationText:'Call in progress',channelName:'Ongoing calls',endLabel:'End call',onError:()=>{if(!cancelled)setError('The call was interrupted.');}});
|
|
44
44
|
const adapters=createNativeCallAdapters({runtime,appearance:design,ringtone:'robono',onError:()=>{if(!cancelled)setError('Call audio is unavailable.');},restoreAudio:()=>setAudioModeAsync({allowsRecording:false,playsInSilentMode:true,interruptionMode:'duckOthers',shouldPlayInBackground:false,shouldRouteThroughEarpiece:false})});
|
|
45
|
-
instance=createGroupCallingController({...adapters,request:createHttpTransport({baseUrl:session.serviceUrl,token:session.token}),appearanceRevision:session.appearanceRevision,resolveGroup:props.resolveGroup,resolveMember:props.resolveMember});
|
|
45
|
+
instance=createGroupCallingController({...adapters,request:createHttpTransport({baseUrl:session.serviceUrl,token:session.token,eventsToken:session.eventsToken}),appearanceRevision:session.appearanceRevision,resolveGroup:props.resolveGroup,resolveMember:props.resolveMember});
|
|
46
46
|
runtime.attach(instance);instance.setForeground(AppState.currentState==='active');unsubscribe=instance.subscribe(renew);
|
|
47
47
|
foreground=AppState.addEventListener('change',value=>{instance?.setForeground(value==='active');if(value==='active')void instance?.refresh();});
|
|
48
48
|
setController(instance);await instance.listen();if(cancelled)return;
|
|
@@ -60,7 +60,11 @@ static void RTCAudio(NSString *selector,AVAudioSession *audio){id s=RTCSession()
|
|
|
60
60
|
if(account.length&&self.enabled){[NSUserDefaults.standardUserDefaults setObject:account forKey:AccountKey];[self registerPush];}
|
|
61
61
|
else {[NSUserDefaults.standardUserDefaults removeObjectForKey:AccountKey];self.registry.desiredPushTypes=[NSSet new];self.token=nil;}
|
|
62
62
|
}
|
|
63
|
-
- (NSDictionary *)state {
|
|
63
|
+
- (NSDictionary *)state {
|
|
64
|
+
id rtc=RTCSession(); NSMutableDictionary *audio=[@{@"active":@(self.audioActive),@"webrtcAvailable":@(rtc!=nil)} mutableCopy];
|
|
65
|
+
for(NSString *name in @[@"useManualAudio",@"isAudioEnabled",@"isActive"]){SEL selector=NSSelectorFromString(name);if([rtc respondsToSelector:selector])audio[name]=@(((BOOL(*)(id,SEL))objc_msgSend)(rtc,selector));}
|
|
66
|
+
return @{@"enabled":@(self.enabled),@"accountScope":self.account?:NSNull.null,@"voipToken":self.token?:NSNull.null,@"calls":self.calls.allValues,@"audio":audio};
|
|
67
|
+
}
|
|
64
68
|
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(PKPushType)type {
|
|
65
69
|
if(![type isEqualToString:PKPushTypeVoIP])return;NSMutableString *token=[NSMutableString new];const unsigned char *bytes=credentials.token.bytes;for(NSUInteger i=0;i<credentials.token.length;i++)[token appendFormat:@"%02x",bytes[i]];self.token=token;[self event:@"token" data:nil];
|
|
66
70
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robono/calling-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Optional branded calling screens, sounds and native audio adapters for Robono calling.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@types/react": "~19.2.2"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@robono/calling": "^0.6.
|
|
84
|
+
"@robono/calling": "^0.6.2",
|
|
85
85
|
"react": ">=18.2 <20",
|
|
86
86
|
"react-native": ">=0.76 <1",
|
|
87
87
|
"react-native-svg": ">=15 <16",
|