I met that situation. So i understood that broadcast-extension terminated earlier than system alert will be appeared. please check my solution:
1 - create property of SampleHandler
private var startedWithError: BroadcastError? = nil
2 - set this error in streamStarted method
override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
guard let streamingSession = streamingSession else {
startedWithError = .failedInitStreamingService
return
}
		// some success code here
}
3 - check error in processSampleBuffer
override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
if let error = startedWithError {
finishBroadcastWithError(error.nsError)
}
P.S. Also you can use DispatchQueue.global.asyncAfter(.now()+0.5){ self.finishBroadcastWithError(error.nsError) } in broadcastStarted
Topic:
Media Technologies
SubTopic:
General
Tags: