Skip to main content
Version: 1.4.x

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

  1. Create you own ViewController and import JoinStories library

  2. Create any UIControl (for example a UIButton) 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, completion: {
// your_completion_block_for_stories_fetch
...
}, onDismiss: { _ in
// 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()