func checkAVPermissions()

in BasicBroadcast/Utils.swift [9:24]


func checkAVPermissions(_ result: @escaping (Bool) -> Void) {
    // Make sure we have both audio and video permissions before setting up the broadcast session.
    checkOrGetPermission(for: .video) { granted in
        guard granted else {
            result(false)
            return
        }
        checkOrGetPermission(for: .audio) { granted in
            guard granted else {
                result(false)
                return
            }
            result(true)
        }
    }
}