BBNativeRenderer
struct BBNativeRenderer: View
A SwiftUI wrapper for BBNativeRendererView (outstream/ad renderer).
Use this for /r/ (renderer) embed URLs that include an appConfig section.
For /a/ (ad-unit) or /p/ (playout) URLs, use BBNativePlayer instead.
Minimal usage (fire-and-forget, auto-cleanup)
BBNativeRenderer(jsonUrl: "https://demo.bbvms.com/r/native_sdk_renderer.json")
.aspectRatio(16/9, contentMode: .fit)
Full control
struct RendererScreen: View {
@State private var rendererState = BBRendererState()
var body: some View {
BBNativeRenderer(
jsonUrl: "https://demo.bbvms.com/r/native_sdk_renderer.json",
state: rendererState
)
.aspectRatio(16/9, contentMode: .fit)
.onDisappear { rendererState.destroy() }
}
}
Important: When using the
init(jsonUrl:options:state:)initializer, callBBRendererState/destroy()from.onDisappearto ensure timely cleanup. The convenienceinit(jsonUrl:options:)handles this automatically.