Standalone player sample
Add the SDK
import JoinStoriesSDK
Init
Call setConfiguration in your AppDelegate method func application(_: didFinishLaunchingWithOptions:)
let configuration = JoinConfiguration(team: "your_join_team")
JoinStories.setConfiguration(configuration)
Layout
Create you own
ViewController
and import JoinStories libraryCreate any
UIControl
(for example aUIButton
) with its target action
button.addTarget(self, action: #selector(_your_method_name_), for: .touchUpInside)
Trigger
To start the player, you need to call the startPlayer method with your standalone configuration:
let standaloneConfig = JoinStoriesStandaloneConfig(alias: "your_join_alias")
JoinStories.startPlayer(config: standaloneConfig, fromController: "your_view_controller", completion: {
// your_completion_block_for_stories_fetch
...
}, onDismiss: {
// dismiss_code (we can present an alert)
})
For a complete list of the available configuration parameter, see the Standalone Player document of the usage section.
To stop a player, you can simply call stopPlayer method:
JoinStories.stopPlayer()