Skip to content

Commit 84bd1db

Browse files
authored
fix: fix library not building when linked as a static framework (#198)
* fix: fix library not building when linked as a static framework * fix: build fixes * chore: separate LivekitReactNative and LivekitReactNativeModule files * chore: lint
1 parent 52151c2 commit 84bd1db

17 files changed

+425
-357
lines changed

example/ios/LivekitReactNativeExample.xcodeproj/project.pbxproj

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
1212
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1313
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14-
4C39C56BAD484C67AA576FFA /* libPods-LivekitReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CA3E69C5B9553B26FBA2DF04 /* libPods-LivekitReactNativeExample.a */; };
14+
28EB7C7580BACD081F485078 /* libPods-LivekitReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AE96F7630C52DE1A637B2D6D /* libPods-LivekitReactNativeExample.a */; };
1515
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
1616
CF01B28CC3BA626D2436FE2C /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = A521D0F9D2FD1DF9BCBBBE8D /* PrivacyInfo.xcprivacy */; };
1717
D767E4EE283D20BC0077477C /* ReplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D767E4ED283D20BC0077477C /* ReplayKit.framework */; };
@@ -69,7 +69,7 @@
6969
47F7ED3B7971BE374F7B8635 /* Pods-LivekitReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LivekitReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-LivekitReactNativeExample/Pods-LivekitReactNativeExample.debug.xcconfig"; sourceTree = "<group>"; };
7070
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = LivekitReactNativeExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
7171
A521D0F9D2FD1DF9BCBBBE8D /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = LivekitReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
72-
CA3E69C5B9553B26FBA2DF04 /* libPods-LivekitReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LivekitReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
72+
AE96F7630C52DE1A637B2D6D /* libPods-LivekitReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LivekitReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
7373
D767E4EC283D20BC0077477C /* BroadcastExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = BroadcastExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
7474
D767E4ED283D20BC0077477C /* ReplayKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReplayKit.framework; path = System/Library/Frameworks/ReplayKit.framework; sourceTree = SDKROOT; };
7575
D767E4F0283D20BC0077477C /* SampleHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleHandler.swift; sourceTree = "<group>"; };
@@ -99,7 +99,7 @@
9999
isa = PBXFrameworksBuildPhase;
100100
buildActionMask = 2147483647;
101101
files = (
102-
4C39C56BAD484C67AA576FFA /* libPods-LivekitReactNativeExample.a in Frameworks */,
102+
28EB7C7580BACD081F485078 /* libPods-LivekitReactNativeExample.a in Frameworks */,
103103
);
104104
runOnlyForDeploymentPostprocessing = 0;
105105
};
@@ -152,8 +152,8 @@
152152
children = (
153153
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
154154
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
155-
CA3E69C5B9553B26FBA2DF04 /* libPods-LivekitReactNativeExample.a */,
156155
D767E4ED283D20BC0077477C /* ReplayKit.framework */,
156+
AE96F7630C52DE1A637B2D6D /* libPods-LivekitReactNativeExample.a */,
157157
);
158158
name = Frameworks;
159159
sourceTree = "<group>";
@@ -621,6 +621,17 @@
621621
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
622622
GCC_WARN_UNUSED_FUNCTION = YES;
623623
GCC_WARN_UNUSED_VARIABLE = YES;
624+
HEADER_SEARCH_PATHS = (
625+
"$(inherited)",
626+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
627+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
628+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
629+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
630+
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
631+
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
632+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
633+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
634+
);
624635
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
625636
LD = "";
626637
LDPLUSPLUS = "";
@@ -696,6 +707,17 @@
696707
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
697708
GCC_WARN_UNUSED_FUNCTION = YES;
698709
GCC_WARN_UNUSED_VARIABLE = YES;
710+
HEADER_SEARCH_PATHS = (
711+
"$(inherited)",
712+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
713+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
714+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
715+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
716+
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
717+
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
718+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
719+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
720+
);
699721
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
700722
LD = "";
701723
LDPLUSPLUS = "";

example/ios/Podfile.lock

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,27 @@ PODS:
88
- hermes-engine/Pre-built (= 0.74.2)
99
- hermes-engine/Pre-built (0.74.2)
1010
- livekit-react-native (2.6.0):
11+
- DoubleConversion
12+
- glog
13+
- hermes-engine
1114
- livekit-react-native-webrtc
15+
- RCT-Folly (= 2024.01.01.00)
16+
- RCTRequired
17+
- RCTTypeSafety
18+
- React-Codegen
1219
- React-Core
20+
- React-debug
21+
- React-Fabric
22+
- React-featureflags
23+
- React-graphics
24+
- React-ImageManager
25+
- React-NativeModulesApple
26+
- React-RCTFabric
27+
- React-rendererdebug
28+
- React-utils
29+
- ReactCommon/turbomodule/bridging
30+
- ReactCommon/turbomodule/core
31+
- Yoga
1332
- livekit-react-native-webrtc (125.0.8):
1433
- React-Core
1534
- WebRTC-SDK (~> 125.6422.07)
@@ -1406,7 +1425,7 @@ SPEC CHECKSUMS:
14061425
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
14071426
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
14081427
hermes-engine: 01d3e052018c2a13937aca1860fbedbccd4a41b7
1409-
livekit-react-native: a5f8534e828282369648242acfae0dae90fdc506
1428+
livekit-react-native: 601d3ac4a75bc0511560ffe40d6d9532d9ffe11b
14101429
livekit-react-native-webrtc: c456181c7c6f9f2b0a79ea14d0d3c97215266ba0
14111430
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
14121431
RCTDeprecation: b03c35057846b685b3ccadc9bfe43e349989cdb2

ios/AudioUtils.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

ios/AudioUtils.m

Lines changed: 0 additions & 48 deletions
This file was deleted.

ios/AudioUtils.swift

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import AVFoundation
2+
3+
public class AudioUtils {
4+
public static func audioSessionModeFromString(_ mode: String) -> AVAudioSession.Mode {
5+
let retMode: AVAudioSession.Mode = switch mode {
6+
case "default_":
7+
.default
8+
case "voicePrompt":
9+
.voicePrompt
10+
case "videoRecording":
11+
.videoRecording
12+
case "videoChat":
13+
.videoChat
14+
case "voiceChat":
15+
.voiceChat
16+
case "gameChat":
17+
.gameChat
18+
case "measurement":
19+
.measurement
20+
case "moviePlayback":
21+
.moviePlayback
22+
case "spokenAudio":
23+
.spokenAudio
24+
default:
25+
.default
26+
}
27+
return retMode
28+
}
29+
30+
public static func audioSessionCategoryFromString(_ category: String) -> AVAudioSession.Category {
31+
let retCategory: AVAudioSession.Category = switch category {
32+
case "ambient":
33+
.ambient
34+
case "soloAmbient":
35+
.soloAmbient
36+
case "playback":
37+
.playback
38+
case "record":
39+
.record
40+
case "playAndRecord":
41+
.playAndRecord
42+
case "multiRoute":
43+
.multiRoute
44+
default:
45+
.ambient
46+
}
47+
return retCategory
48+
}
49+
}

0 commit comments

Comments
 (0)