在现有应用中添加广播上传扩展
我想将广播上传扩展名
添加到现有的Swift本机应用程序中。此扩展名用于捕获用户屏幕的内容
,例如屏幕共享
。
目的:
我正在添加jitsi Meets sdk
在我的应用中进行视频通话。此SDK需要一个广播上传扩展
才能启用屏幕共享选项。
我尝试过的内容:
我尝试使用新应用程序添加广播上传扩展
,然后将所有配置复制到我现有的应用中。
将配置从新应用程序复制到现有应用的步骤:
复制文件
atomic.swift
,darwinnotificationcenter.swift
,socketconnection.swift.swift
从广播中JITSI中给出的屏幕共享样本的扩展文件夹Meet SDK
示例项目。根据
的上述链接,添加了jitsi Meeting SDK示例
.entiTlements
文件在
.entitlement项目文件夹组
在主项目文件夹中的主项目文件夹组
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.jitsi.example-screensharing.appgroup</string>
</array>
- 。它的内容从新应用到
info.plist
文件中的现有应用程序。 - 给予
麦克风,相机&amp;本地网络
在info.plist
文件中的现有应用中。 - 添加键
rtcscreensharingextension
&amp;rtcappGroupidentifier
在info.plist
文件中的现有应用中。
info.plist
(点5):
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.broadcast-services-upload</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SampleHandler</string>
<key>RPBroadcastProcessMode</key>
<string>RPBroadcastProcessModeSampleBuffer</string>
</dict>
info.plist
(点6):
<key>NSMicrophoneUsageDescription</key>
<string>This will allow you to use microphone to record audio messages and join ${PRODUCT_NAME} meetings</string>
<key>NSLocalNetworkUsageDescription</key>
<string>Local network access is needed for P2P connections.</string>
<key>NSCameraUsageDescription</key>
<string>This lets you do things like take a photo and set it as your profile picture or share photos and videos with other team members within your workspace.
</string>
info.plist
(点7):
<key>RTCScreenSharingExtension</key>
<string>com.jitsi.example-screensharing.broadcast.extension</string>
<key>RTCAppGroupIdentifier</key>
<string>group.com.jitsi.example-screensharing.appgroup</string>
错误:错误:
在现有应用中遇到错误
Multiple commands produce '/Users/UserName/Library/Developer/Xcode/DerivedData/project-name-cgxqvnvmumzlucbokufvjzcnobpn/Build/Products/Debug-iphonesimulator/project-name.app/Info.plist':
1) Target 'project-name' (project 'project-name') has copy command from '/Users/Username/workspace/github/project-name/project-name/Info.plist' to '/Users/Username/Library/Developer/Xcode/DerivedData/project-name-cgxqvnvmumzlucbokufvjzcnobpn/Build/Products/Debug-iphonesimulator/project-name.app/Info.plist'
2) Target 'project-name' (project 'project-name') has process command with output '/Users/Username/Library/Developer/Xcode/DerivedData/project-name-cgxqvnvmumzlucbokufvjzcnobpn/Build/Products/Debug-iphonesimulator/project-name.app/Info.plist'
I want to add a Broadcast Upload Extension
to an existing swift native app. This extension is used for capturing the contents of the user's screen
like screen sharing
.
Purpose:
I am adding Jitsi Meet SDK
for video calling in my app. And this SDK requires a broadcast upload extension
to enable the screen sharing option.
What I have tried:
I tried to add a broadcast upload extension
with a new app and copy all the configuration into my existing app.
Steps of copying configuration from new app to existing app:
Copy files
Atomic.swift
,DarwinNotificationCenter.swift
,SocketConnection.swift
from broadcast extension folder of screen sharing sample given inJitsi Meet SDK
sample project. HereAdded
.entitlements
file as per the above link ofJitsi Meet SDK sample
Added the group key in the
.entitlements
file in the main project folder group
.entitlements
file In main project folder group :
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.jitsi.example-screensharing.appgroup</string>
</array>
- Copy the
NSExtension
key and its content from the new app to the existing one ininfo.plist
file. - Give permissions to the
microphone, camera & local network
in the existing app ininfo.plist
file. - Add keys
RTCScreenSharingExtension
&RTCAppGroupIdentifier
in the existing app ininfo.plist
file.
info.plist
(point 5):
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.broadcast-services-upload</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SampleHandler</string>
<key>RPBroadcastProcessMode</key>
<string>RPBroadcastProcessModeSampleBuffer</string>
</dict>
info.plist
(point 6):
<key>NSMicrophoneUsageDescription</key>
<string>This will allow you to use microphone to record audio messages and join ${PRODUCT_NAME} meetings</string>
<key>NSLocalNetworkUsageDescription</key>
<string>Local network access is needed for P2P connections.</string>
<key>NSCameraUsageDescription</key>
<string>This lets you do things like take a photo and set it as your profile picture or share photos and videos with other team members within your workspace.
</string>
info.plist
(point 7):
<key>RTCScreenSharingExtension</key>
<string>com.jitsi.example-screensharing.broadcast.extension</string>
<key>RTCAppGroupIdentifier</key>
<string>group.com.jitsi.example-screensharing.appgroup</string>
Error:
Getting an error in an existing app that
Multiple commands produce '/Users/UserName/Library/Developer/Xcode/DerivedData/project-name-cgxqvnvmumzlucbokufvjzcnobpn/Build/Products/Debug-iphonesimulator/project-name.app/Info.plist':
1) Target 'project-name' (project 'project-name') has copy command from '/Users/Username/workspace/github/project-name/project-name/Info.plist' to '/Users/Username/Library/Developer/Xcode/DerivedData/project-name-cgxqvnvmumzlucbokufvjzcnobpn/Build/Products/Debug-iphonesimulator/project-name.app/Info.plist'
2) Target 'project-name' (project 'project-name') has process command with output '/Users/Username/Library/Developer/Xcode/DerivedData/project-name-cgxqvnvmumzlucbokufvjzcnobpn/Build/Products/Debug-iphonesimulator/project-name.app/Info.plist'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在尝试了许多解决方案之后,我发现该修复程序非常简单。这一切都归结为以正确的顺序调整构建阶段。
要解决问题,请如下图所示排列构建阶段:
此次要调整应解决问题。有时,最简单的解决方案是最有效的!
After trying numerous solutions, I discovered that the fix was surprisingly simple. It all came down to adjusting the build phases in the correct order.
To resolve the issue, arrange the build phases as shown in the following image:
This minor adjustment should resolve the problem. Sometimes, the simplest solutions are the most effective!