【问题标题】:ReplayKit Broadcast upload extension - Service not foundReplayKit 广播上传扩展 - 找不到服务
【发布时间】:2021-01-10 20:43:15
【问题描述】:

我正在开发一个 IOS swift 应用程序,它允许用户记录整个屏幕、任何应用程序甚至主屏幕。

为了做到这一点,我在我的应用中添加了一个广播上传扩展。

首先,我使用RPSystemBroadcastPickerView 类向我的视图添加一个记录按钮,允许用户打开记​​录弹出窗口并选择他想要向哪个应用程序广播屏幕流。它工作正常:

但我想避免这一步,在应用启动时直接打开弹出窗口。

所以我写了以下代码来做到这一点:

RPBroadcastActivityViewController.load(withPreferredExtension: "ch.jroueche.RecordApp.TestScreen", handler:  {broadcastAVC,error in
    guard error == nil else {
        print("Cannot load Broadcast Activity View Controller.")
        return
    }
    
    if let broadcastAVC = broadcastAVC {
        broadcastAVC.delegate = self
        self.present(broadcastAVC, animated: true, completion: {
            // broadcastactivityviewcontroller will perform the callback when the broadcast starts (or fails)
            print("I've START")
            
        })
    }
})

enter code here RPSystemBroadcastPickerView 解决方案不同,我收到以下错误:

找不到首选的广播服务。

我的问题类似于以下帖子: App not showing up as a broadcast service in RPBroadcastActivityViewController

我还添加了扩展,首选扩展标识符是正确的。

为什么可以使用RPSystemBroadcastPickerView 而不是以编程方式使用RPBroadcastActivityViewControllerclass。这对我来说没有意义。

有人知道可能是什么问题,我该如何解决?或者为了做这个屏幕记录的解决方法。

提前致谢

【问题讨论】:

  • 我也有同样的问题。你解决了吗?
  • 不,我没有。我暂时使用变通方法打开 RPSystemBroadcastPickerView 并模拟点击它。此解决方案有效,但有点垃圾。

标签: ios swift replaykit


【解决方案1】:

似乎RPBroadcastActivityViewController 仅显示Broadcast Setup UI Extension,而RPSystemBroadcastPickerView 仅显示Broadcast Upload Extension。但我不知道为什么,因为它们都被声明为显示可用提供者/服务的列表。

如果有人能提供有关该主题的更多详细信息,那将非常有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-22
    • 1970-01-01
    • 1970-01-01
    • 2017-01-31
    • 2021-07-26
    相关资源
    最近更新 更多