livevoice-sdk-react-native 2.0.0 → 3.0.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.
Files changed (221) hide show
  1. package/README.md +158 -7
  2. package/android/build.gradle +18 -6
  3. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +121 -221
  4. package/android/src/main/java/io/livevoice/react/__SDK.kt +17 -3
  5. package/ios/LiveVoiceRNBridge.swift +362 -0
  6. package/ios/LiveVoiceSdkReactNative.mm +247 -145
  7. package/ios/__SDK.h +16 -2
  8. package/ios/livevoice_spm_backport.rb +202 -0
  9. package/lib/module/components/BrandingView.js +71 -50
  10. package/lib/module/components/BrandingView.js.map +1 -1
  11. package/lib/module/components/ChannelView.js +368 -54
  12. package/lib/module/components/ChannelView.js.map +1 -1
  13. package/lib/module/components/ErrorView.js +17 -16
  14. package/lib/module/components/ErrorView.js.map +1 -1
  15. package/lib/module/components/LiveVoiceSpinner.js +81 -0
  16. package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
  17. package/lib/module/components/LiveVoiceView.js +351 -104
  18. package/lib/module/components/LiveVoiceView.js.map +1 -1
  19. package/lib/module/components/PasswordPrompt.js +165 -0
  20. package/lib/module/components/PasswordPrompt.js.map +1 -0
  21. package/lib/module/components/PlayButtonView.js +192 -254
  22. package/lib/module/components/PlayButtonView.js.map +1 -1
  23. package/lib/module/components/ReconnectingView.js +43 -62
  24. package/lib/module/components/ReconnectingView.js.map +1 -1
  25. package/lib/module/components/WarningView.js +12 -10
  26. package/lib/module/components/WarningView.js.map +1 -1
  27. package/lib/module/icons/branding-ios.png +0 -0
  28. package/lib/module/icons/camera-off-android.png +0 -0
  29. package/lib/module/icons/camera-off-android@2x.png +0 -0
  30. package/lib/module/icons/camera-off-android@3x.png +0 -0
  31. package/lib/module/icons/cpu-android.png +0 -0
  32. package/lib/module/icons/cpu-android@2x.png +0 -0
  33. package/lib/module/icons/cpu-android@3x.png +0 -0
  34. package/lib/module/icons/cpu-ios.png +0 -0
  35. package/lib/module/icons/cpu-ios@2x.png +0 -0
  36. package/lib/module/icons/cpu-ios@3x.png +0 -0
  37. package/lib/module/icons/lock-android.png +0 -0
  38. package/lib/module/icons/lock-android@2x.png +0 -0
  39. package/lib/module/icons/lock-android@3x.png +0 -0
  40. package/lib/module/icons/lock-ios.png +0 -0
  41. package/lib/module/icons/lock-ios@2x.png +0 -0
  42. package/lib/module/icons/lock-ios@3x.png +0 -0
  43. package/lib/module/icons/mic-off-android.png +0 -0
  44. package/lib/module/icons/mic-off-android@2x.png +0 -0
  45. package/lib/module/icons/mic-off-android@3x.png +0 -0
  46. package/lib/module/icons/mic-slash-ios.png +0 -0
  47. package/lib/module/icons/mic-slash-ios@2x.png +0 -0
  48. package/lib/module/icons/mic-slash-ios@3x.png +0 -0
  49. package/lib/module/icons/video-slash-ios.png +0 -0
  50. package/lib/module/icons/video-slash-ios@2x.png +0 -0
  51. package/lib/module/icons/video-slash-ios@3x.png +0 -0
  52. package/lib/module/index.js +24 -225
  53. package/lib/module/index.js.map +1 -1
  54. package/lib/module/sdk/Bridge.js +236 -0
  55. package/lib/module/sdk/Bridge.js.map +1 -0
  56. package/lib/module/sdk/Event.js +160 -0
  57. package/lib/module/sdk/Event.js.map +1 -0
  58. package/lib/module/sdk/Lifecycle.js +331 -0
  59. package/lib/module/sdk/Lifecycle.js.map +1 -0
  60. package/lib/module/sdk/LiveVoiceSdk.js +365 -0
  61. package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
  62. package/lib/module/sdk/LiveVoiceState.js +234 -0
  63. package/lib/module/sdk/LiveVoiceState.js.map +1 -0
  64. package/lib/module/sdk/LogEntries.js +99 -0
  65. package/lib/module/sdk/LogEntries.js.map +1 -0
  66. package/lib/module/sdk/Models.js +2 -0
  67. package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
  68. package/lib/module/sdk/NativeSdkVersions.js +24 -0
  69. package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
  70. package/lib/module/sdk/Observables.js +391 -0
  71. package/lib/module/sdk/Observables.js.map +1 -0
  72. package/lib/module/sdk/Passwords.js +298 -0
  73. package/lib/module/sdk/Passwords.js.map +1 -0
  74. package/lib/module/sdk/Playback.js +35 -0
  75. package/lib/module/sdk/Playback.js.map +1 -0
  76. package/lib/module/specs/NativeLiveVoiceSdk.js +12 -10
  77. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  78. package/lib/module/util/Colors.js +14 -11
  79. package/lib/module/util/Colors.js.map +1 -1
  80. package/lib/module/util/Translations.js +46 -21
  81. package/lib/module/util/Translations.js.map +1 -1
  82. package/lib/module/util/freeze.js +26 -0
  83. package/lib/module/util/freeze.js.map +1 -0
  84. package/lib/module/util/logger.js +114 -0
  85. package/lib/module/util/logger.js.map +1 -0
  86. package/lib/typescript/src/components/BrandingView.d.ts +4 -0
  87. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
  88. package/lib/typescript/src/components/ChannelView.d.ts +29 -3
  89. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
  90. package/lib/typescript/src/components/ErrorView.d.ts +5 -3
  91. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
  92. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
  93. package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
  94. package/lib/typescript/src/components/LiveVoiceView.d.ts +85 -3
  95. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
  96. package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
  97. package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
  98. package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
  99. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
  100. package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
  101. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
  102. package/lib/typescript/src/components/WarningView.d.ts.map +1 -1
  103. package/lib/typescript/src/index.d.ts +15 -144
  104. package/lib/typescript/src/index.d.ts.map +1 -1
  105. package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
  106. package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
  107. package/lib/typescript/src/sdk/Event.d.ts +97 -0
  108. package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
  109. package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
  110. package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
  111. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +215 -0
  112. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
  113. package/lib/typescript/src/sdk/LiveVoiceState.d.ts +80 -0
  114. package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
  115. package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
  116. package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
  117. package/lib/typescript/src/sdk/Models.d.ts +114 -0
  118. package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
  119. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
  120. package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
  121. package/lib/typescript/src/sdk/Observables.d.ts +123 -0
  122. package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
  123. package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
  124. package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
  125. package/lib/typescript/src/sdk/Playback.d.ts +9 -0
  126. package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
  127. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +35 -29
  128. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  129. package/lib/typescript/src/util/Colors.d.ts.map +1 -1
  130. package/lib/typescript/src/util/Translations.d.ts +30 -8
  131. package/lib/typescript/src/util/Translations.d.ts.map +1 -1
  132. package/lib/typescript/src/util/freeze.d.ts +6 -0
  133. package/lib/typescript/src/util/freeze.d.ts.map +1 -0
  134. package/lib/typescript/src/util/logger.d.ts +33 -0
  135. package/lib/typescript/src/util/logger.d.ts.map +1 -0
  136. package/livevoice-sdk-react-native.podspec +41 -16
  137. package/package.json +26 -14
  138. package/src/components/BrandingView.tsx +55 -66
  139. package/src/components/ChannelView.tsx +342 -48
  140. package/src/components/ErrorView.tsx +21 -22
  141. package/src/components/LiveVoiceSpinner.tsx +87 -0
  142. package/src/components/LiveVoiceView.tsx +360 -151
  143. package/src/components/PasswordPrompt.tsx +144 -0
  144. package/src/components/PlayButtonView.tsx +177 -279
  145. package/src/components/ReconnectingView.tsx +40 -86
  146. package/src/components/WarningView.tsx +12 -10
  147. package/src/icons/branding-ios.png +0 -0
  148. package/src/icons/camera-off-android.png +0 -0
  149. package/src/icons/camera-off-android@2x.png +0 -0
  150. package/src/icons/camera-off-android@3x.png +0 -0
  151. package/src/icons/cpu-android.png +0 -0
  152. package/src/icons/cpu-android@2x.png +0 -0
  153. package/src/icons/cpu-android@3x.png +0 -0
  154. package/src/icons/cpu-ios.png +0 -0
  155. package/src/icons/cpu-ios@2x.png +0 -0
  156. package/src/icons/cpu-ios@3x.png +0 -0
  157. package/src/icons/lock-android.png +0 -0
  158. package/src/icons/lock-android@2x.png +0 -0
  159. package/src/icons/lock-android@3x.png +0 -0
  160. package/src/icons/lock-ios.png +0 -0
  161. package/src/icons/lock-ios@2x.png +0 -0
  162. package/src/icons/lock-ios@3x.png +0 -0
  163. package/src/icons/mic-off-android.png +0 -0
  164. package/src/icons/mic-off-android@2x.png +0 -0
  165. package/src/icons/mic-off-android@3x.png +0 -0
  166. package/src/icons/mic-slash-ios.png +0 -0
  167. package/src/icons/mic-slash-ios@2x.png +0 -0
  168. package/src/icons/mic-slash-ios@3x.png +0 -0
  169. package/src/icons/video-slash-ios.png +0 -0
  170. package/src/icons/video-slash-ios@2x.png +0 -0
  171. package/src/icons/video-slash-ios@3x.png +0 -0
  172. package/src/index.tsx +105 -252
  173. package/src/sdk/Bridge.ts +259 -0
  174. package/src/sdk/Event.ts +187 -0
  175. package/src/sdk/Lifecycle.ts +366 -0
  176. package/src/sdk/LiveVoiceSdk.ts +384 -0
  177. package/src/sdk/LiveVoiceState.ts +259 -0
  178. package/src/sdk/LogEntries.ts +88 -0
  179. package/src/sdk/Models.ts +129 -0
  180. package/src/sdk/NativeSdkVersions.ts +21 -0
  181. package/src/sdk/Observables.ts +414 -0
  182. package/src/sdk/Passwords.ts +286 -0
  183. package/src/sdk/Playback.ts +30 -0
  184. package/src/specs/NativeLiveVoiceSdk.ts +56 -46
  185. package/src/util/Colors.ts +14 -11
  186. package/src/util/Translations.ts +46 -22
  187. package/src/util/freeze.ts +23 -0
  188. package/src/util/logger.ts +119 -0
  189. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeLiveVoiceSdkSpec.java +0 -186
  190. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  191. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec-generated.cpp +0 -235
  192. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec.h +0 -31
  193. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -341
  194. package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -85
  195. package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -79
  196. package/lib/module/components/AudioOutputSwitchView.js +0 -138
  197. package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
  198. package/lib/module/components/index.js +0 -22
  199. package/lib/module/components/index.js.map +0 -1
  200. package/lib/module/icons/mic.png +0 -0
  201. package/lib/module/util/ForegroundServiceConfig.js +0 -28
  202. package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
  203. package/lib/module/util/PlayingState.js +0 -21
  204. package/lib/module/util/PlayingState.js.map +0 -1
  205. package/lib/module/util/UIState.js +0 -4
  206. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
  207. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  208. package/lib/typescript/src/components/index.d.ts +0 -9
  209. package/lib/typescript/src/components/index.d.ts.map +0 -1
  210. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -12
  211. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  212. package/lib/typescript/src/util/PlayingState.d.ts +0 -7
  213. package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
  214. package/lib/typescript/src/util/UIState.d.ts +0 -66
  215. package/lib/typescript/src/util/UIState.d.ts.map +0 -1
  216. package/src/components/AudioOutputSwitchView.tsx +0 -146
  217. package/src/components/index.tsx +0 -19
  218. package/src/icons/mic.png +0 -0
  219. package/src/util/ForegroundServiceConfig.tsx +0 -32
  220. package/src/util/PlayingState.ts +0 -18
  221. package/src/util/UIState.ts +0 -89
@@ -1,17 +1,18 @@
1
- # ===----------------------------------------------------------------------===//
2
- #
3
- # This source file is part of the LiveVoice SDK project
4
- #
5
- # Copyright (c) LiveVoice GmbH
6
- # Licensed under the MIT license
7
- #
8
- # See LICENSE for license information
9
- #
10
- # SPDX-License-Identifier: MIT
11
- #
12
- # ===----------------------------------------------------------------------===//
1
+ #===----------------------------------------------------------------------===#
2
+ #
3
+ # This source file is part of the LiveVoice SDK project
4
+ #
5
+ # Copyright (c) LiveVoice GmbH
6
+ # Licensed under the MIT license
7
+ #
8
+ # See LICENSE for license information
9
+ #
10
+ # SPDX-License-Identifier: MIT
11
+ #
12
+ #===----------------------------------------------------------------------===#
13
13
 
14
14
  require "json"
15
+ require_relative "ios/livevoice_spm_backport"
15
16
 
16
17
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
17
18
 
@@ -24,13 +25,37 @@ Pod::Spec.new do |s|
24
25
  s.authors = package["author"]
25
26
 
26
27
  s.platforms = { :ios => min_ios_version_supported }
27
- s.source = { :git => "#{package["repository"]}", :tag => "#{s.version}" }
28
+ # Autolinking reads this podspec from node_modules, so the source is never
29
+ # fetched; CocoaPods still needs one. It names the published npm package.
30
+ s.source = { :http => "https://registry.npmjs.org/livevoice-sdk-react-native/-/livevoice-sdk-react-native-#{s.version}.tgz" }
28
31
 
29
32
  s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
30
33
  s.exclude_files = "ios/generated/**/*"
31
-
32
- # The native LiveVoice SDK
33
- s.dependency "LiveVoiceSDK", '~> 2.0.0'
34
+ # The TurboModule's headers are internal to the pod; apps import nothing
35
+ # from it.
36
+ s.private_header_files = "ios/**/*.h"
37
+
38
+ # The native LiveVoice SDK, from its Swift package. The version is exact:
39
+ # each wrapper release pins the native SDK it was tested with.
40
+ # LIVEVOICE_SDK_SWIFT_URL replaces the package's URL, to test a build of
41
+ # the native SDK that is not published yet.
42
+ native_url = ENV.fetch("LIVEVOICE_SDK_SWIFT_URL", "https://github.com/LiveVoiceOfficial/livevoice-sdk-swift.git")
43
+ native_requirement = { kind: "exactVersion", version: "3.0.0" }
44
+ # The LiveVoiceSDK product brings both dynamic frameworks.
45
+ native_frameworks = ["LiveVoiceSDK", "WebRTC"]
46
+ if LiveVoiceSPMBackport.native_support?
47
+ spm_dependency(s, url: native_url, requirement: native_requirement,
48
+ products: ["LiveVoiceSDK"], embed_frameworks: native_frameworks)
49
+ else
50
+ spm_dependency(s, url: native_url, requirement: native_requirement,
51
+ products: ["LiveVoiceSDK"])
52
+ LiveVoiceSPMBackport.install(
53
+ pod_name: s.name,
54
+ frameworks: native_frameworks,
55
+ requirement_comment: "#{native_url} #{native_requirement}"
56
+ )
57
+ end
58
+ s.swift_version = "5.9"
34
59
 
35
60
 
36
61
  install_modules_dependencies(s)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "livevoice-sdk-react-native",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "The LiveVoice SDK for integrating simultaneous interpretation, AI voice translation, guided tours, silent events, and more into your app.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -13,13 +13,13 @@
13
13
  "./package.json": "./package.json"
14
14
  },
15
15
  "files": [
16
- "src",
17
- "lib",
18
- "android",
19
- "ios",
20
- "cpp",
21
- "*.podspec",
22
- "react-native.config.js",
16
+ "./src",
17
+ "./lib",
18
+ "./android",
19
+ "./ios",
20
+ "./cpp",
21
+ "./livevoice-sdk-react-native.podspec",
22
+ "./react-native.config.js",
23
23
  "!ios/build",
24
24
  "!ios/generated",
25
25
  "!android/generated",
@@ -37,9 +37,22 @@
37
37
  "example": "yarn workspace livevoice-sdk-react-native-example",
38
38
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
39
39
  "prepare": "bob build",
40
+ "prepublishOnly": "node tool/check-publish.mjs",
41
+ "test": "jest --runInBand",
40
42
  "typecheck": "tsc",
41
- "native-version-generate": "node generate-native-versions.js",
42
- "clear-all": "sh clear-all.sh"
43
+ "check:headers": "node tool/license-headers.mjs --check",
44
+ "fix:headers": "node tool/license-headers.mjs --fix",
45
+ "check:pins": "node tool/check-native-pins.mjs",
46
+ "headers:check": "node tool/license-headers.mjs --check",
47
+ "headers:fix": "node tool/license-headers.mjs --fix",
48
+ "native-version-generate": "node tool/generate-native-versions.mjs",
49
+ "versions:sync": "node tool/generate-native-versions.mjs",
50
+ "test:matrix-tool": "node --test tool/tests/*.test.mjs",
51
+ "matrix:list": "node tool/test-rn-version.mjs --list-versions-json",
52
+ "matrix:test": "node tool/test-rn-version.mjs",
53
+ "clear-all": "node tool/clean-all.mjs",
54
+ "clean:all": "node tool/clean-all.mjs",
55
+ "typecheck:example": "tsc -p example/tsconfig.json"
43
56
  },
44
57
  "keywords": [
45
58
  "react-native",
@@ -51,10 +64,6 @@
51
64
  "silent events",
52
65
  "realtime audio"
53
66
  ],
54
- "repository": {
55
- "type": "git",
56
- "url": "git+https://livevoice.iolivevoice.io.git"
57
- },
58
67
  "author": "LiveVoice GmbH <sdk-support@livevoice.io> (https://livevoice.io)",
59
68
  "license": "MIT",
60
69
  "bugs": {
@@ -67,11 +76,14 @@
67
76
  "devDependencies": {
68
77
  "@react-native-community/cli": "latest",
69
78
  "@react-native/babel-preset": "0.85.0",
79
+ "@react-native/jest-preset": "0.85.0",
70
80
  "@types/react": "^19.2.0",
71
81
  "del-cli": "^7.0.0",
82
+ "jest": "^29.7.0",
72
83
  "react": "19.2.3",
73
84
  "react-native": "0.85.0",
74
85
  "react-native-builder-bob": "^0.41.0",
86
+ "react-test-renderer": "19.2.3",
75
87
  "turbo": "^2.8.21",
76
88
  "typescript": "^6.0.2"
77
89
  },
@@ -1,81 +1,70 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the LiveVoice SDK project
4
+ //
5
+ // Copyright (c) LiveVoice GmbH
6
+ // Licensed under the MIT license
7
+ //
8
+ // See LICENSE for license information
9
+ //
10
+ // SPDX-License-Identifier: MIT
11
+ //
12
+ //===----------------------------------------------------------------------===//
11
13
 
12
14
  import React from 'react';
13
- import {
14
- View,
15
- Text,
16
- useColorScheme,
17
- StyleSheet,
18
- Image,
19
- Pressable
20
- } from 'react-native';
15
+ import { Image, Platform, Pressable, StyleSheet, Text, useColorScheme } from 'react-native';
21
16
 
22
- import { COLORS } from '../util/Colors';
23
- import { openLiveVoiceWebsite } from 'livevoice-sdk-react-native';
17
+ import { openLiveVoiceWebsite } from '../sdk/LiveVoiceSdk';
18
+ import { Translations } from '../util/Translations';
24
19
 
25
20
  export interface BrandingProps {
26
21
  isDarkMode?: boolean;
27
22
  }
28
23
 
24
+ /**
25
+ * The "Live Audio Streaming by LiveVoice" footer, drawn exactly as the native SDK of the platform
26
+ * draws it: iOS `LogoView`, Android `LiveVoiceSdkBranding`. Change them together.
27
+ */
29
28
  export const BrandingView: React.FC<BrandingProps> = (props) => {
30
- const isDarkMode = props.isDarkMode ?? useColorScheme() === 'dark';
31
-
32
- const openLink = async () => { openLiveVoiceWebsite(); }
29
+ const scheme = useColorScheme();
30
+ const isDarkMode = props.isDarkMode ?? scheme === 'dark';
31
+ // Both native footers draw the text and the logo in plain black or white.
32
+ const color = isDarkMode ? '#FFFFFF' : '#000000';
33
33
 
34
34
  return (
35
- <Pressable onPress={openLink} style={{ width: '100%', alignItems: 'center' }}>
36
- <View style={styles.container}>
37
- <Text style={[styles.text, isDarkMode ? styles.darkText : styles.lightText]}>
38
- Live Audio Streaming by
39
- </Text>
40
- <Image
41
- source={require('../icons/branding.png')}
42
- style={[
43
- styles.image,
44
- {
45
- height: 30,
46
- tintColor: isDarkMode ? COLORS.white : COLORS.black,
47
- },
48
- ]}
49
- resizeMode="contain"
50
- />
51
- </View>
35
+ <Pressable onPress={() => { openLiveVoiceWebsite(); }} style={styles.container}>
36
+ <Text style={[styles.text, { color }]} allowFontScaling={Platform.OS !== 'ios'}>
37
+ {Translations.streamingByTitle()}
38
+ </Text>
39
+ <Image
40
+ source={Platform.OS === 'ios' ? require('../icons/branding-ios.png') : require('../icons/branding.png')}
41
+ style={[styles.logo, { tintColor: color }]}
42
+ resizeMode="contain"
43
+ />
52
44
  </Pressable>
53
45
  );
54
46
  };
55
47
 
56
- const styles = StyleSheet.create({
57
- container: {
58
- padding: 12,
59
- alignItems: 'center',
60
- justifyContent: 'center',
61
- borderRadius: 8,
62
- width: 250,
63
- },
64
- text: {
65
- textAlign: 'center',
66
- fontSize: 16,
67
- fontWeight: '500',
68
- marginBottom: 4,
69
- },
70
- darkText: {
71
- color: '#fff',
72
- },
73
- lightText: {
74
- color: '#191919',
75
- },
76
- image: {
77
- width: '100%',
78
- height: undefined,
79
- aspectRatio: 4,
80
- },
81
- });
48
+ const styles = StyleSheet.create(Platform.OS === 'ios'
49
+ ? {
50
+ // iOS: `.padding()` (16 pt) around a 4 pt stack of a fixed 12 pt medium text and the logo
51
+ // set 100 pt wide. The logo artwork keeps the margins of the SDK's SVG (196 × 48).
52
+ container: { alignSelf: 'center', alignItems: 'center', padding: 16 },
53
+ text: { textAlign: 'center', fontSize: 12, fontWeight: '500', marginBottom: 4 },
54
+ logo: { width: 100, height: (100 * 48) / 196 },
55
+ }
56
+ : {
57
+ // Android: 8 dp above (from the view), below and at the sides; bodyMedium text and a
58
+ // 92 × 28 dp logo, each inset 8 dp more at the sides.
59
+ container: { alignSelf: 'center', alignItems: 'center', paddingTop: 8, paddingBottom: 8, paddingHorizontal: 8 },
60
+ text: {
61
+ textAlign: 'center',
62
+ fontSize: 14,
63
+ lineHeight: 20,
64
+ letterSpacing: 0.25,
65
+ fontWeight: '400',
66
+ includeFontPadding: false,
67
+ marginHorizontal: 8,
68
+ },
69
+ logo: { width: 92, height: 28, marginHorizontal: 8 },
70
+ });