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.
- package/README.md +158 -7
- package/android/build.gradle +18 -6
- package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +121 -221
- package/android/src/main/java/io/livevoice/react/__SDK.kt +17 -3
- package/ios/LiveVoiceRNBridge.swift +362 -0
- package/ios/LiveVoiceSdkReactNative.mm +247 -145
- package/ios/__SDK.h +16 -2
- package/ios/livevoice_spm_backport.rb +202 -0
- package/lib/module/components/BrandingView.js +71 -50
- package/lib/module/components/BrandingView.js.map +1 -1
- package/lib/module/components/ChannelView.js +368 -54
- package/lib/module/components/ChannelView.js.map +1 -1
- package/lib/module/components/ErrorView.js +17 -16
- package/lib/module/components/ErrorView.js.map +1 -1
- package/lib/module/components/LiveVoiceSpinner.js +81 -0
- package/lib/module/components/LiveVoiceSpinner.js.map +1 -0
- package/lib/module/components/LiveVoiceView.js +351 -104
- package/lib/module/components/LiveVoiceView.js.map +1 -1
- package/lib/module/components/PasswordPrompt.js +165 -0
- package/lib/module/components/PasswordPrompt.js.map +1 -0
- package/lib/module/components/PlayButtonView.js +192 -254
- package/lib/module/components/PlayButtonView.js.map +1 -1
- package/lib/module/components/ReconnectingView.js +43 -62
- package/lib/module/components/ReconnectingView.js.map +1 -1
- package/lib/module/components/WarningView.js +12 -10
- package/lib/module/components/WarningView.js.map +1 -1
- package/lib/module/icons/branding-ios.png +0 -0
- package/lib/module/icons/camera-off-android.png +0 -0
- package/lib/module/icons/camera-off-android@2x.png +0 -0
- package/lib/module/icons/camera-off-android@3x.png +0 -0
- package/lib/module/icons/cpu-android.png +0 -0
- package/lib/module/icons/cpu-android@2x.png +0 -0
- package/lib/module/icons/cpu-android@3x.png +0 -0
- package/lib/module/icons/cpu-ios.png +0 -0
- package/lib/module/icons/cpu-ios@2x.png +0 -0
- package/lib/module/icons/cpu-ios@3x.png +0 -0
- package/lib/module/icons/lock-android.png +0 -0
- package/lib/module/icons/lock-android@2x.png +0 -0
- package/lib/module/icons/lock-android@3x.png +0 -0
- package/lib/module/icons/lock-ios.png +0 -0
- package/lib/module/icons/lock-ios@2x.png +0 -0
- package/lib/module/icons/lock-ios@3x.png +0 -0
- package/lib/module/icons/mic-off-android.png +0 -0
- package/lib/module/icons/mic-off-android@2x.png +0 -0
- package/lib/module/icons/mic-off-android@3x.png +0 -0
- package/lib/module/icons/mic-slash-ios.png +0 -0
- package/lib/module/icons/mic-slash-ios@2x.png +0 -0
- package/lib/module/icons/mic-slash-ios@3x.png +0 -0
- package/lib/module/icons/video-slash-ios.png +0 -0
- package/lib/module/icons/video-slash-ios@2x.png +0 -0
- package/lib/module/icons/video-slash-ios@3x.png +0 -0
- package/lib/module/index.js +24 -225
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/Bridge.js +236 -0
- package/lib/module/sdk/Bridge.js.map +1 -0
- package/lib/module/sdk/Event.js +160 -0
- package/lib/module/sdk/Event.js.map +1 -0
- package/lib/module/sdk/Lifecycle.js +331 -0
- package/lib/module/sdk/Lifecycle.js.map +1 -0
- package/lib/module/sdk/LiveVoiceSdk.js +365 -0
- package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
- package/lib/module/sdk/LiveVoiceState.js +234 -0
- package/lib/module/sdk/LiveVoiceState.js.map +1 -0
- package/lib/module/sdk/LogEntries.js +99 -0
- package/lib/module/sdk/LogEntries.js.map +1 -0
- package/lib/module/sdk/Models.js +2 -0
- package/lib/module/{util/UIState.js.map → sdk/Models.js.map} +1 -1
- package/lib/module/sdk/NativeSdkVersions.js +24 -0
- package/lib/module/sdk/NativeSdkVersions.js.map +1 -0
- package/lib/module/sdk/Observables.js +391 -0
- package/lib/module/sdk/Observables.js.map +1 -0
- package/lib/module/sdk/Passwords.js +298 -0
- package/lib/module/sdk/Passwords.js.map +1 -0
- package/lib/module/sdk/Playback.js +35 -0
- package/lib/module/sdk/Playback.js.map +1 -0
- package/lib/module/specs/NativeLiveVoiceSdk.js +12 -10
- package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
- package/lib/module/util/Colors.js +14 -11
- package/lib/module/util/Colors.js.map +1 -1
- package/lib/module/util/Translations.js +46 -21
- package/lib/module/util/Translations.js.map +1 -1
- package/lib/module/util/freeze.js +26 -0
- package/lib/module/util/freeze.js.map +1 -0
- package/lib/module/util/logger.js +114 -0
- package/lib/module/util/logger.js.map +1 -0
- package/lib/typescript/src/components/BrandingView.d.ts +4 -0
- package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
- package/lib/typescript/src/components/ChannelView.d.ts +29 -3
- package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
- package/lib/typescript/src/components/ErrorView.d.ts +5 -3
- package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts +16 -0
- package/lib/typescript/src/components/LiveVoiceSpinner.d.ts.map +1 -0
- package/lib/typescript/src/components/LiveVoiceView.d.ts +85 -3
- package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
- package/lib/typescript/src/components/PasswordPrompt.d.ts +13 -0
- package/lib/typescript/src/components/PasswordPrompt.d.ts.map +1 -0
- package/lib/typescript/src/components/PlayButtonView.d.ts +12 -329
- package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
- package/lib/typescript/src/components/ReconnectingView.d.ts +6 -3
- package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
- package/lib/typescript/src/components/WarningView.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +15 -144
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/sdk/Bridge.d.ts +36 -0
- package/lib/typescript/src/sdk/Bridge.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Event.d.ts +97 -0
- package/lib/typescript/src/sdk/Event.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts +191 -0
- package/lib/typescript/src/sdk/Lifecycle.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +215 -0
- package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts +80 -0
- package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
- package/lib/typescript/src/sdk/LogEntries.d.ts +28 -0
- package/lib/typescript/src/sdk/LogEntries.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Models.d.ts +114 -0
- package/lib/typescript/src/sdk/Models.d.ts.map +1 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts +6 -0
- package/lib/typescript/src/sdk/NativeSdkVersions.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Observables.d.ts +123 -0
- package/lib/typescript/src/sdk/Observables.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Passwords.d.ts +72 -0
- package/lib/typescript/src/sdk/Passwords.d.ts.map +1 -0
- package/lib/typescript/src/sdk/Playback.d.ts +9 -0
- package/lib/typescript/src/sdk/Playback.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +35 -29
- package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
- package/lib/typescript/src/util/Colors.d.ts.map +1 -1
- package/lib/typescript/src/util/Translations.d.ts +30 -8
- package/lib/typescript/src/util/Translations.d.ts.map +1 -1
- package/lib/typescript/src/util/freeze.d.ts +6 -0
- package/lib/typescript/src/util/freeze.d.ts.map +1 -0
- package/lib/typescript/src/util/logger.d.ts +33 -0
- package/lib/typescript/src/util/logger.d.ts.map +1 -0
- package/livevoice-sdk-react-native.podspec +41 -16
- package/package.json +26 -14
- package/src/components/BrandingView.tsx +55 -66
- package/src/components/ChannelView.tsx +342 -48
- package/src/components/ErrorView.tsx +21 -22
- package/src/components/LiveVoiceSpinner.tsx +87 -0
- package/src/components/LiveVoiceView.tsx +360 -151
- package/src/components/PasswordPrompt.tsx +144 -0
- package/src/components/PlayButtonView.tsx +177 -279
- package/src/components/ReconnectingView.tsx +40 -86
- package/src/components/WarningView.tsx +12 -10
- package/src/icons/branding-ios.png +0 -0
- package/src/icons/camera-off-android.png +0 -0
- package/src/icons/camera-off-android@2x.png +0 -0
- package/src/icons/camera-off-android@3x.png +0 -0
- package/src/icons/cpu-android.png +0 -0
- package/src/icons/cpu-android@2x.png +0 -0
- package/src/icons/cpu-android@3x.png +0 -0
- package/src/icons/cpu-ios.png +0 -0
- package/src/icons/cpu-ios@2x.png +0 -0
- package/src/icons/cpu-ios@3x.png +0 -0
- package/src/icons/lock-android.png +0 -0
- package/src/icons/lock-android@2x.png +0 -0
- package/src/icons/lock-android@3x.png +0 -0
- package/src/icons/lock-ios.png +0 -0
- package/src/icons/lock-ios@2x.png +0 -0
- package/src/icons/lock-ios@3x.png +0 -0
- package/src/icons/mic-off-android.png +0 -0
- package/src/icons/mic-off-android@2x.png +0 -0
- package/src/icons/mic-off-android@3x.png +0 -0
- package/src/icons/mic-slash-ios.png +0 -0
- package/src/icons/mic-slash-ios@2x.png +0 -0
- package/src/icons/mic-slash-ios@3x.png +0 -0
- package/src/icons/video-slash-ios.png +0 -0
- package/src/icons/video-slash-ios@2x.png +0 -0
- package/src/icons/video-slash-ios@3x.png +0 -0
- package/src/index.tsx +105 -252
- package/src/sdk/Bridge.ts +259 -0
- package/src/sdk/Event.ts +187 -0
- package/src/sdk/Lifecycle.ts +366 -0
- package/src/sdk/LiveVoiceSdk.ts +384 -0
- package/src/sdk/LiveVoiceState.ts +259 -0
- package/src/sdk/LogEntries.ts +88 -0
- package/src/sdk/Models.ts +129 -0
- package/src/sdk/NativeSdkVersions.ts +21 -0
- package/src/sdk/Observables.ts +414 -0
- package/src/sdk/Passwords.ts +286 -0
- package/src/sdk/Playback.ts +30 -0
- package/src/specs/NativeLiveVoiceSdk.ts +56 -46
- package/src/util/Colors.ts +14 -11
- package/src/util/Translations.ts +46 -22
- package/src/util/freeze.ts +23 -0
- package/src/util/logger.ts +119 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeLiveVoiceSdkSpec.java +0 -186
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
- package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec-generated.cpp +0 -235
- package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec.h +0 -31
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -341
- package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -85
- package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -79
- package/lib/module/components/AudioOutputSwitchView.js +0 -138
- package/lib/module/components/AudioOutputSwitchView.js.map +0 -1
- package/lib/module/components/index.js +0 -22
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/icons/mic.png +0 -0
- package/lib/module/util/ForegroundServiceConfig.js +0 -28
- package/lib/module/util/ForegroundServiceConfig.js.map +0 -1
- package/lib/module/util/PlayingState.js +0 -21
- package/lib/module/util/PlayingState.js.map +0 -1
- package/lib/module/util/UIState.js +0 -4
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts +0 -6
- package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +0 -1
- package/lib/typescript/src/components/index.d.ts +0 -9
- package/lib/typescript/src/components/index.d.ts.map +0 -1
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +0 -12
- package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +0 -1
- package/lib/typescript/src/util/PlayingState.d.ts +0 -7
- package/lib/typescript/src/util/PlayingState.d.ts.map +0 -1
- package/lib/typescript/src/util/UIState.d.ts +0 -66
- package/lib/typescript/src/util/UIState.d.ts.map +0 -1
- package/src/components/AudioOutputSwitchView.tsx +0 -146
- package/src/components/index.tsx +0 -19
- package/src/icons/mic.png +0 -0
- package/src/util/ForegroundServiceConfig.tsx +0 -32
- package/src/util/PlayingState.ts +0 -18
- package/src/util/UIState.ts +0 -89
|
@@ -0,0 +1,202 @@
|
|
|
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
|
+
|
|
14
|
+
# React Native before 0.89 attaches a Swift package from `spm_dependency` to
|
|
15
|
+
# the pod only. Two things then go wrong for a package with dynamic binary
|
|
16
|
+
# frameworks, as the native LiveVoice SDK is:
|
|
17
|
+
#
|
|
18
|
+
# - CocoaPods embeds only the frameworks of pods, so the SDK and WebRTC are
|
|
19
|
+
# linked but never copied into the app, which fails at launch with dyld
|
|
20
|
+
# "Library not loaded".
|
|
21
|
+
# - Xcode writes each binary target's signature both to the shared products
|
|
22
|
+
# dir and to the pod's build dir, and archiving fails on the duplicate.
|
|
23
|
+
#
|
|
24
|
+
# React Native 0.87 and 0.88 add a third: they build the pod straight into the
|
|
25
|
+
# shared products dir and rewrite the app's references to its module map, but
|
|
26
|
+
# name the file after the pod (livevoice-sdk-react-native) instead of its
|
|
27
|
+
# module (livevoice_sdk_react_native), so the app's build cannot find it.
|
|
28
|
+
#
|
|
29
|
+
# React Native 0.89 fixes all three (facebook/react-native#58781). This
|
|
30
|
+
# backports that fix for this pod only, from the podspec, so apps need no
|
|
31
|
+
# Podfile change; with Expo, prebuild would discard one anyway. It does
|
|
32
|
+
# nothing when React Native already has the fix.
|
|
33
|
+
|
|
34
|
+
module LiveVoiceSPMBackport
|
|
35
|
+
EMBED_FUNCTION = 'livevoice_install_spm_framework'
|
|
36
|
+
SIGNATURE_PHASE_NAME = '[LV] Remove duplicate Swift package xcframework signatures'
|
|
37
|
+
|
|
38
|
+
# Taken from React Native 0.89's install_spm_framework: embeds framework $1
|
|
39
|
+
# from where Xcode puts binary targets, if it is a dynamic one.
|
|
40
|
+
EMBED_FUNCTION_SOURCE = <<~'SH'
|
|
41
|
+
livevoice_install_spm_framework()
|
|
42
|
+
{
|
|
43
|
+
local dir
|
|
44
|
+
for dir in "${PODS_CONFIGURATION_BUILD_DIR}" "${PODS_CONFIGURATION_BUILD_DIR}/PackageFrameworks" "${OBJROOT}/UninstalledProducts/${PLATFORM_NAME}"; do
|
|
45
|
+
if [ -d "$dir/$1.framework" ]; then
|
|
46
|
+
if file -b "$dir/$1.framework/$1" | grep -q "dynamically linked"; then
|
|
47
|
+
install_framework "$dir/$1.framework"
|
|
48
|
+
fi
|
|
49
|
+
return
|
|
50
|
+
fi
|
|
51
|
+
done
|
|
52
|
+
}
|
|
53
|
+
SH
|
|
54
|
+
|
|
55
|
+
# The installed React Native embeds Swift package frameworks itself.
|
|
56
|
+
def self.native_support?
|
|
57
|
+
defined?(SPMManager) && SPMManager.const_defined?(:EMBED_FUNCTION)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Hooks into React Native's own post-install step for `pod_name`.
|
|
61
|
+
def self.install(pod_name:, frameworks:, requirement_comment:)
|
|
62
|
+
return if native_support? || !defined?(SPMManager)
|
|
63
|
+
|
|
64
|
+
@pods ||= {}
|
|
65
|
+
@pods[pod_name] = { frameworks: frameworks, comment: requirement_comment }
|
|
66
|
+
SPMManager.prepend(Hook) unless SPMManager.ancestors.include?(Hook)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.pods
|
|
70
|
+
@pods || {}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
module Hook
|
|
74
|
+
def apply_on_post_install(installer)
|
|
75
|
+
super
|
|
76
|
+
LiveVoiceSPMBackport.pods.each do |pod_name, info|
|
|
77
|
+
LiveVoiceSPMBackport.embed_frameworks(installer, pod_name, info)
|
|
78
|
+
if LiveVoiceSPMBackport.built_into_products_dir?(installer.pods_project, pod_name)
|
|
79
|
+
# One copy of everything, signatures included: nothing to remove.
|
|
80
|
+
LiveVoiceSPMBackport.fix_modulemap_references(installer, pod_name)
|
|
81
|
+
else
|
|
82
|
+
LiveVoiceSPMBackport.remove_duplicate_signatures(installer.pods_project, pod_name)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def self.embed_frameworks(installer, pod_name, info)
|
|
89
|
+
installer.aggregate_targets.each do |aggregate_target|
|
|
90
|
+
next unless aggregate_target.pod_targets.any? { |t| t.name == pod_name }
|
|
91
|
+
|
|
92
|
+
script_path = aggregate_target.embed_frameworks_script_path
|
|
93
|
+
script = File.exist?(script_path) ? File.read(script_path) : nil
|
|
94
|
+
next if script&.include?("#{EMBED_FUNCTION}()")
|
|
95
|
+
|
|
96
|
+
# A project that already gets the frameworks into the app keeps its own
|
|
97
|
+
# way, so nothing is copied twice.
|
|
98
|
+
if embedded_elsewhere?(aggregate_target, script, info[:frameworks])
|
|
99
|
+
::Pod::UI.puts "[LiveVoice] #{aggregate_target.name} already embeds #{info[:frameworks].join(', ')}"
|
|
100
|
+
next
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
anchor = /^if \[ "\$\{COCOAPODS_PARALLEL_CODE_SIGN\}" == "true" \]; then$/
|
|
104
|
+
unless script&.match?(anchor)
|
|
105
|
+
# Failing here beats an app that installs and then crashes at launch.
|
|
106
|
+
raise ::Pod::Informative, <<~MSG
|
|
107
|
+
[LiveVoice] Cannot embed #{info[:frameworks].join(' and ')} in #{aggregate_target.name}:
|
|
108
|
+
#{script.nil? ? "#{script_path} does not exist" : "#{script_path} does not have the expected CocoaPods layout"}.
|
|
109
|
+
Without them the app fails to launch with dyld "Library not loaded".
|
|
110
|
+
Embed them another way, for example by adding the LiveVoiceSDK Swift package
|
|
111
|
+
product to the app target, or move to React Native 0.89 or later, which embeds
|
|
112
|
+
them itself.
|
|
113
|
+
MSG
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# The comment names the version, so a version change rewrites this
|
|
117
|
+
# script, an input of the embed phase, and the phase runs again.
|
|
118
|
+
calls = info[:frameworks].map { |name| "#{EMBED_FUNCTION} \"#{name}\"\n" }.join
|
|
119
|
+
File.write(script_path, script.sub(anchor) { "#{EMBED_FUNCTION_SOURCE}# #{info[:comment]}\n#{calls}#{$&}" })
|
|
120
|
+
::Pod::UI.puts "[LiveVoice] Embedding #{info[:frameworks].join(', ')} in #{aggregate_target.name}"
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# The app target uses the LiveVoiceSDK package product itself, so Xcode
|
|
125
|
+
# embeds its frameworks, or the embed script already installs them.
|
|
126
|
+
def self.embedded_elsewhere?(aggregate_target, script, frameworks)
|
|
127
|
+
by_package = aggregate_target.user_targets.any? do |target|
|
|
128
|
+
target.respond_to?(:package_product_dependencies) &&
|
|
129
|
+
target.package_product_dependencies.any? { |d| d.product_name == 'LiveVoiceSDK' }
|
|
130
|
+
end
|
|
131
|
+
by_script = !script.nil? && frameworks.all? { |name| script.include?("/#{name}.framework\"") }
|
|
132
|
+
by_package || by_script
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# React Native 0.87 and later build a static pod with a Swift package
|
|
136
|
+
# straight into the shared products dir.
|
|
137
|
+
def self.built_into_products_dir?(project, pod_name)
|
|
138
|
+
target = project.targets.find { |t| t.name == pod_name }
|
|
139
|
+
!target.nil? && target.build_configurations.all? do |config|
|
|
140
|
+
config.build_settings['CONFIGURATION_BUILD_DIR'] == '${PODS_CONFIGURATION_BUILD_DIR}'
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Points the app's -fmodule-map-file flags at the module map where the pod
|
|
145
|
+
# now builds it. Like React Native 0.89, this changes the in-memory xcconfig
|
|
146
|
+
# attributes, because later post-install steps save the same objects again.
|
|
147
|
+
def self.fix_modulemap_references(installer, pod_name)
|
|
148
|
+
pod_target = installer.pod_targets.find { |t| t.name == pod_name }
|
|
149
|
+
return if pod_target.nil?
|
|
150
|
+
|
|
151
|
+
module_name = pod_target.product_module_name
|
|
152
|
+
installer.aggregate_targets.each do |aggregate_target|
|
|
153
|
+
next unless aggregate_target.pod_targets.include?(pod_target)
|
|
154
|
+
|
|
155
|
+
aggregate_target.xcconfigs.each do |config_name, config_file|
|
|
156
|
+
changed = false
|
|
157
|
+
%w[OTHER_CFLAGS OTHER_SWIFT_FLAGS].each do |key|
|
|
158
|
+
value = config_file.attributes[key]
|
|
159
|
+
next unless value
|
|
160
|
+
|
|
161
|
+
updated = value
|
|
162
|
+
.gsub("${PODS_CONFIGURATION_BUILD_DIR}/#{pod_name}/#{module_name}.modulemap",
|
|
163
|
+
"${PODS_CONFIGURATION_BUILD_DIR}/#{module_name}.modulemap")
|
|
164
|
+
.gsub("${PODS_CONFIGURATION_BUILD_DIR}/#{pod_name}.modulemap",
|
|
165
|
+
"${PODS_CONFIGURATION_BUILD_DIR}/#{module_name}.modulemap")
|
|
166
|
+
next if updated == value
|
|
167
|
+
|
|
168
|
+
config_file.attributes[key] = updated
|
|
169
|
+
changed = true
|
|
170
|
+
end
|
|
171
|
+
config_file.save_as(aggregate_target.xcconfig_path(config_name)) if changed
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def self.remove_duplicate_signatures(project, pod_name)
|
|
177
|
+
target = project.targets.find { |t| t.name == pod_name }
|
|
178
|
+
return if target.nil? || target.shell_script_build_phases.any? { |p| p.name == SIGNATURE_PHASE_NAME }
|
|
179
|
+
|
|
180
|
+
# A fresh UUID that is really unused: Pod::Project's generator skips the
|
|
181
|
+
# check and can collide during post_install (see React Native's spm.rb).
|
|
182
|
+
uuid = project.generate_uuid
|
|
183
|
+
uuid = project.generate_uuid while project.objects_by_uuid.key?(uuid)
|
|
184
|
+
phase = Xcodeproj::Project::Object::PBXShellScriptBuildPhase.new(project, uuid)
|
|
185
|
+
phase.initialize_defaults
|
|
186
|
+
phase.name = SIGNATURE_PHASE_NAME
|
|
187
|
+
# Removes only copies that also exist in the shared products dir, so the
|
|
188
|
+
# only copy stays if the pod is built there after all (for example by the
|
|
189
|
+
# app's own Podfile, after this ran).
|
|
190
|
+
phase.shell_script = <<~'SH'
|
|
191
|
+
for signature in "${CONFIGURATION_BUILD_DIR}"/*.xcframework-*.signature; do
|
|
192
|
+
[ -e "$signature" ] || continue
|
|
193
|
+
[ "${CONFIGURATION_BUILD_DIR}" != "${PODS_CONFIGURATION_BUILD_DIR}" ] || continue
|
|
194
|
+
if [ -e "${PODS_CONFIGURATION_BUILD_DIR}/$(basename "$signature")" ]; then
|
|
195
|
+
rm -f "$signature"
|
|
196
|
+
fi
|
|
197
|
+
done
|
|
198
|
+
SH
|
|
199
|
+
phase.always_out_of_date = '1'
|
|
200
|
+
target.build_phases << phase
|
|
201
|
+
end
|
|
202
|
+
end
|
|
@@ -1,72 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
//===----------------------------------------------------------------------===//
|
|
4
|
+
//
|
|
5
|
+
// This source file is part of the LiveVoice SDK project
|
|
6
|
+
//
|
|
7
|
+
// Copyright (c) LiveVoice GmbH
|
|
8
|
+
// Licensed under the MIT license
|
|
9
|
+
//
|
|
10
|
+
// See LICENSE for license information
|
|
11
|
+
//
|
|
12
|
+
// SPDX-License-Identifier: MIT
|
|
13
|
+
//
|
|
14
|
+
//===----------------------------------------------------------------------===//
|
|
13
15
|
|
|
14
16
|
import React from 'react';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
17
|
+
import { Image, Platform, Pressable, StyleSheet, Text, useColorScheme } from 'react-native';
|
|
18
|
+
import { openLiveVoiceWebsite } from "../sdk/LiveVoiceSdk.js";
|
|
19
|
+
import { Translations } from "../util/Translations.js";
|
|
18
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
/**
|
|
22
|
+
* The "Live Audio Streaming by LiveVoice" footer, drawn exactly as the native SDK of the platform
|
|
23
|
+
* draws it: iOS `LogoView`, Android `LiveVoiceSdkBranding`. Change them together.
|
|
24
|
+
*/
|
|
19
25
|
export const BrandingView = props => {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return /*#__PURE__*/
|
|
25
|
-
onPress:
|
|
26
|
-
|
|
27
|
-
width: '100%',
|
|
28
|
-
alignItems: 'center'
|
|
26
|
+
const scheme = useColorScheme();
|
|
27
|
+
const isDarkMode = props.isDarkMode ?? scheme === 'dark';
|
|
28
|
+
// Both native footers draw the text and the logo in plain black or white.
|
|
29
|
+
const color = isDarkMode ? '#FFFFFF' : '#000000';
|
|
30
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
31
|
+
onPress: () => {
|
|
32
|
+
openLiveVoiceWebsite();
|
|
29
33
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
34
|
+
style: styles.container,
|
|
35
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
36
|
+
style: [styles.text, {
|
|
37
|
+
color
|
|
38
|
+
}],
|
|
39
|
+
allowFontScaling: Platform.OS !== 'ios',
|
|
40
|
+
children: Translations.streamingByTitle()
|
|
41
|
+
}), /*#__PURE__*/_jsx(Image, {
|
|
42
|
+
source: Platform.OS === 'ios' ? require('../icons/branding-ios.png') : require('../icons/branding.png'),
|
|
43
|
+
style: [styles.logo, {
|
|
44
|
+
tintColor: color
|
|
45
|
+
}],
|
|
46
|
+
resizeMode: "contain"
|
|
47
|
+
})]
|
|
44
48
|
});
|
|
45
49
|
};
|
|
46
|
-
const styles = StyleSheet.create({
|
|
50
|
+
const styles = StyleSheet.create(Platform.OS === 'ios' ? {
|
|
51
|
+
// iOS: `.padding()` (16 pt) around a 4 pt stack of a fixed 12 pt medium text and the logo
|
|
52
|
+
// set 100 pt wide. The logo artwork keeps the margins of the SDK's SVG (196 × 48).
|
|
47
53
|
container: {
|
|
48
|
-
|
|
54
|
+
alignSelf: 'center',
|
|
49
55
|
alignItems: 'center',
|
|
50
|
-
|
|
51
|
-
borderRadius: 8,
|
|
52
|
-
width: 250
|
|
56
|
+
padding: 16
|
|
53
57
|
},
|
|
54
58
|
text: {
|
|
55
59
|
textAlign: 'center',
|
|
56
|
-
fontSize:
|
|
60
|
+
fontSize: 12,
|
|
57
61
|
fontWeight: '500',
|
|
58
62
|
marginBottom: 4
|
|
59
63
|
},
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
logo: {
|
|
65
|
+
width: 100,
|
|
66
|
+
height: 100 * 48 / 196
|
|
67
|
+
}
|
|
68
|
+
} : {
|
|
69
|
+
// Android: 8 dp above (from the view), below and at the sides; bodyMedium text and a
|
|
70
|
+
// 92 × 28 dp logo, each inset 8 dp more at the sides.
|
|
71
|
+
container: {
|
|
72
|
+
alignSelf: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
paddingTop: 8,
|
|
75
|
+
paddingBottom: 8,
|
|
76
|
+
paddingHorizontal: 8
|
|
62
77
|
},
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
text: {
|
|
79
|
+
textAlign: 'center',
|
|
80
|
+
fontSize: 14,
|
|
81
|
+
lineHeight: 20,
|
|
82
|
+
letterSpacing: 0.25,
|
|
83
|
+
fontWeight: '400',
|
|
84
|
+
includeFontPadding: false,
|
|
85
|
+
marginHorizontal: 8
|
|
65
86
|
},
|
|
66
|
-
|
|
67
|
-
width:
|
|
68
|
-
height:
|
|
69
|
-
|
|
87
|
+
logo: {
|
|
88
|
+
width: 92,
|
|
89
|
+
height: 28,
|
|
90
|
+
marginHorizontal: 8
|
|
70
91
|
}
|
|
71
92
|
});
|
|
72
93
|
//# sourceMappingURL=BrandingView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","Image","Platform","Pressable","StyleSheet","Text","useColorScheme","openLiveVoiceWebsite","Translations","jsx","_jsx","jsxs","_jsxs","BrandingView","props","scheme","isDarkMode","color","onPress","style","styles","container","children","text","allowFontScaling","OS","streamingByTitle","source","require","logo","tintColor","resizeMode","create","alignSelf","alignItems","padding","textAlign","fontSize","fontWeight","marginBottom","width","height","paddingTop","paddingBottom","paddingHorizontal","lineHeight","letterSpacing","includeFontPadding","marginHorizontal"],"sourceRoot":"../../../src","sources":["components/BrandingView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,cAAc,QAAQ,cAAc;AAE3F,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,YAAY,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMpD;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAqC,GAAIC,KAAK,IAAK;EAC9D,MAAMC,MAAM,GAAGT,cAAc,CAAC,CAAC;EAC/B,MAAMU,UAAU,GAAGF,KAAK,CAACE,UAAU,IAAID,MAAM,KAAK,MAAM;EACxD;EACA,MAAME,KAAK,GAAGD,UAAU,GAAG,SAAS,GAAG,SAAS;EAEhD,oBACEJ,KAAA,CAACT,SAAS;IAACe,OAAO,EAAEA,CAAA,KAAM;MAAEX,oBAAoB,CAAC,CAAC;IAAE,CAAE;IAACY,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,gBAC7EZ,IAAA,CAACL,IAAI;MAACc,KAAK,EAAE,CAACC,MAAM,CAACG,IAAI,EAAE;QAAEN;MAAM,CAAC,CAAE;MAACO,gBAAgB,EAAEtB,QAAQ,CAACuB,EAAE,KAAK,KAAM;MAAAH,QAAA,EAC5Ed,YAAY,CAACkB,gBAAgB,CAAC;IAAC,CAC5B,CAAC,eACPhB,IAAA,CAACT,KAAK;MACJ0B,MAAM,EAAEzB,QAAQ,CAACuB,EAAE,KAAK,KAAK,GAAGG,OAAO,CAAC,2BAA2B,CAAC,GAAGA,OAAO,CAAC,uBAAuB,CAAE;MACxGT,KAAK,EAAE,CAACC,MAAM,CAACS,IAAI,EAAE;QAAEC,SAAS,EAAEb;MAAM,CAAC,CAAE;MAC3Cc,UAAU,EAAC;IAAS,CACrB,CAAC;EAAA,CACO,CAAC;AAEhB,CAAC;AAED,MAAMX,MAAM,GAAGhB,UAAU,CAAC4B,MAAM,CAAC9B,QAAQ,CAACuB,EAAE,KAAK,KAAK,GAClD;EACE;EACA;EACAJ,SAAS,EAAE;IAAEY,SAAS,EAAE,QAAQ;IAAEC,UAAU,EAAE,QAAQ;IAAEC,OAAO,EAAE;EAAG,CAAC;EACrEZ,IAAI,EAAE;IAAEa,SAAS,EAAE,QAAQ;IAAEC,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE,KAAK;IAAEC,YAAY,EAAE;EAAE,CAAC;EAC/EV,IAAI,EAAE;IAAEW,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAG,GAAG,GAAG,EAAE,GAAI;EAAI;AAC/C,CAAC,GACD;EACE;EACA;EACApB,SAAS,EAAE;IAAEY,SAAS,EAAE,QAAQ;IAAEC,UAAU,EAAE,QAAQ;IAAEQ,UAAU,EAAE,CAAC;IAAEC,aAAa,EAAE,CAAC;IAAEC,iBAAiB,EAAE;EAAE,CAAC;EAC/GrB,IAAI,EAAE;IACJa,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE,EAAE;IACZQ,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBR,UAAU,EAAE,KAAK;IACjBS,kBAAkB,EAAE,KAAK;IACzBC,gBAAgB,EAAE;EACpB,CAAC;EACDnB,IAAI,EAAE;IAAEW,KAAK,EAAE,EAAE;IAAEC,MAAM,EAAE,EAAE;IAAEO,gBAAgB,EAAE;EAAE;AACrD,CAAC,CAAC","ignoreList":[]}
|