Use from a CTA in a story

If you want to add deep link logic from a story, you can implement the onContentLinkClick method from JOINStoriesListenerDelegate.

This event tells you that a user has clicked on a CTA in the player. It indicates the CTA link in parameters and you can customize the behaviour based on this link (deeplink, path, https, etc...).
The method should return true if the app manages the link click behaviour, and false if the app does not want to catch the link provided. If a false is returned, the SDK will try to open the link in the default browser of the device. By default, the method return false.

func onContentLinkClick(url: String?) -> Bool {
	return false
}

Opening an story from a deep link

If you want to open an story from an external deep link (like notification, in-app event, ...), you can use the standalone player to display it.
The deep link must include the alias corresponding to the widget in order to display the story.

Example:

import JOINStoriesSDK

final class ViewController: UIViewController {
 
    private var playerView: JoinStoriesPlayer!
  
    let deeplink = "app://myView/0/story/story-alias" // It's an example of deep link
    let storyAlias = getAlias(deeplink)
    
    override func viewDidLoad() {
        super.viewDidLoad()

        playerView = JoinStoriesPlayer(alias: storyAlias)
    }

    func showPlayer() {
        self.playerView.show()
    }
    
}