Open full conversation page directly

Show the full conversation screen directly in your iOS app.

OpenWeb allows you to open a full conversation screen directly. Prior to this feature, OpenWeb's implementation required a developer to display the Pre-Conversation View Controller. Then, the user would need to tap a button to display the full conversation.

Implementation

Use the following guidance to implement this feature.


  1. Initialize the SDK and create an instance of SpotImSDKFlowCoordinator as described in
    Add and initialize the OpenWeb iOS SDK and SpotImSDKFlowCoordinator

  1. Create and set SpotImArticleMetadata.
let articleMetadata = SpotImArticleMetadata(url: "URL TO THE ARTICLE PAGE                                           ON THE WEB", 
                      title: "ARTICLE TITLE", 
                      subtitle: "ARTICLE SUBTITLE", 
                      thumbnailUrl: "URL TO ARTICLE THUMBNAIL IMAGE")

Present full conversation modally

3a. Full conversation can be presented as a modal on top of article ViewController by calling openFullConversationViewController on the SpotImSDKFlowCoordinator instance.

self.coordinator.openFullConversationViewController(
  postId: self.postId,
  articleMetadata: self.metadata,
  presentationalMode: .present(viewController: self),
    completion: completionHandler)

// Method signature:
public func openFullConversationViewController(postId: String,
                                   articleMetadata: SpotImArticleMetadata,
                                   presentationalMode: SPViewControllerPresentationalMode,
                                   selectedCommentId: String? = nil,
                                   completion: SPShowFullConversationCompletionHandler? = nil)

// SPViewControllerPresentationalMode enum
public enum SPViewControllerPresentationalMode {
    case present(viewController: UIViewController)
    case push(navigationController: UINavigationController)
}

Push full conversation to the host app navigation controller

3b. Full conversation can be pushed on top of the host app own navigation controller by calling openFullConversationViewController on the SpotImSDKFlowCoordinator.

self.coordinator.openFullConversationViewController(
  postId: self.postId,
  articleMetadata: self.metadata,
  presentationalMode: .push(navigationController: self.navigationController!)
    completion: completionHandler)

// Same method as above but with ".push" mode

Did this page help you?