Stream your PBJ.live content from your iOS App.
Xcode
> File
> Swift packages
> Add Package Dependency
https://github.com/pbj-apps/Live-ios-sdk
A good place to do this is typically the AppDelegate
.
import Live
// [...]
LiveSDK.initialize(apiKey: "YOUR_API_KEY")
Typical usage is that you have a "Watch live" button that you only want to show if there is an actual episode currently live.
LiveSDK.isEpisodeLive { isLive, error in
// -> isLive is true if there is any episode live.
// Show player here. (step 4)
}
You can also pass your showID
as a parameter to query live episodes, but this time for a specific show.
You can find your showId
in your web dashboard. Select the show you want and grab it's id from the browser's url.
This api exists with both callbacks and Combine publishers so your are free to choose the version that fits best with your app.
let livePlayerVC = LiveSDK.player() // Optionally pass a showId.
livePlayerVC.delegate = self
Without a showId
parameter, the player will display the first live show it finds.
present(livePlayerVC, animated: true, completion: nil)
Checkout the example App provided in this repository to see a typical integration. With the test app, you can input your Organization api key and battle test your own environment.
Create a github issue and we'll help you from there ❤️