App not showing up as a broadcast service in RPBroadcastActivityViewController

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 12:29:07

问题


I'm trying to use Replaykit to start a broadcast session (recording the App screen works ok) and it opens up a picker from where broadcasting Apps can be picked, Youtube, Facebook and Periscope show up but not my App, code:

if #available(iOS 10.0, *) {
  RPBroadcastActivityViewController.load { broadcastAVC, error in
    guard error == nil else {
      print("Cannot load Broadcast Activity View Controller.")
      return
    }
    if let broadcastAVC = broadcastAVC {
      broadcastAVC.delegate = self
      self.viewController.present(broadcastAVC, animated: true, completion: {
        // broadcastactivityviewcontroller will perform the callback when the broadcast starts (or fails)
      })
    }
  }
}

Full source code here, the code is in the startBroadcast function.

I also tried loading using withPreferredExtension and it says preferred broadcast service not found. When I go to the control centre to try starting a broadcast session I see no Start Broadcast button and no Apps, just Start Recording, I'm using IOS11 so I tried with a phone using IOS12 and same result concerning control centre. How can I get my App to show in the picker, thanks?


回答1:


Had to add the Broadcast Extension, in Xcode, File -> New -> Target -> Broadcast Upload Extension. This extension was then displayed in the picker.



来源:https://stackoverflow.com/questions/54536382/app-not-showing-up-as-a-broadcast-service-in-rpbroadcastactivityviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!