Open full conversation page directly

Show the full conversation screen directly in your Android app.

📘

BETA API

Please be aware that API adjustments in the upcoming SDK versions may be required to also support loading and showing interstitial ads when transitioning to the full conversation screen.

If you have any beta feedback that you would like to share, please contact
us at [email protected].


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 fragment. Then, the user would need to tap the fragment to display the full conversation.


Implementation

Use the following guidance to implement this feature.


  1. In onCreate() of the application class, initialize the OpenWeb SDK with your Spot_ID.
SpotIm.init(
    this,
    "SPOT_ID"
)
SpotIm.init(
    context,
    "SPOT_ID"
);

  1. In onCreate() of an article activity, add the full conversation to the Activity.
SpotIm.getConversationIntent(context, CONVERSATION_ID, object :
    SpotCallback<Intent> {
        override fun onSuccess(intent: Intent) {
            startActivity(intent)
        }

        override fun onFailure(exception: SpotException) {
            //Handle error here
    }
})
SpotIm.getConversationIntent(context, CONVERSATION_ID, new SpotCallback<Intent>() {
    @Override 
    public void onSuccess(Intent intent) { 
        startActivity(intent)
    } 
    
    @Override 
    public void onFailure(SpotException exception) {    
        // Handle error here
    } 
});

  1. (Optional) In your Activity, use ConversationOptions.Builder() to create and define a ConversationOptions object named options and pass it to SpotIm.getConversationIntent.
val themeMode = SpotImThemeMode.DARK
val backgroundColor = Color.parseColor("#000000")
val options = ConversationOptions.Builder()
    .addTheme(SpotImThemeParams(false, themeMode, backgroundColor))
    .configureArticle(
        Article(
            "URL", "THUMBNAIL_URL", "TITLE", "SUBTITLE")
        )
    .addSortType(SortType.SORT_NEWEST)
    .build()

SpotIm.getConversationIntent(context, CONVERSATION_ID, options, object :
    SpotCallback<Intent> {
        override fun onSuccess(intent: Intent) {
            startActivity(intent)
        }

        override fun onFailure(exception: SpotException) {
            // Handle error here
    }
})
SpotImThemeMode themeMode = SpotImThemeMode.DARK;
int backgroundColor = Color.parseColor("#00000");
SpotImThemeParams themeParams = new SpotImThemeParams(false, themeMode, backgroundColor);   

ConversationOptions options = ConversationOptions.Builder()
    .addMaxCountOfPreConversationComments(2)
    .addTheme(themeParams)
    .configureArticle(new Article(
        "URL", "THUMBNAIL_URL", "TITLE", "SUBTITLE"))
    .addSortType(SortType.Companion.getSORT_NEWEST())
    .build()

SpotIm.getConversationIntent(context, CONVERSATION_ID, options, new SpotCallback<Intent>() {
    @Override 
    public void onSuccess(Intent intent) { 
        startActivity(intent)
    } 
    
    @Override 
    public void onFailure(SpotException exception) {    
        // Handle error here
    } 
});


Did this page help you?