Live Chat

Add a chat container

  1. Create your VFArticleMetadata object.
VFArticleMetadata articleMetadata = new VFArticleMetadata("https://test.com", "STORY TITLE", "STORY_DESC", "https://test.com");
val articleMetadata = VFArticleMetadata(URL(""), "STORY TITLE", "STORY_DESC", new URL("STORY_PICTURE_URL"));
  1. Create your VFSettings object.
VFColors colors = new VFColors(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary), ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryLight), Color.WHITE);
VFSettings vfSettings = new VFSettings(colors);
val colors = VFColors(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary), ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryLight), Color.WHITE);
val vfSettings = VFSettings(colors);
  1. Implement the VFLoginInterface interface.
@Override
public void startLogin() {
    Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
    startActivity(intent);
}
override fun startLogin() {
    val intent = Intent(applicationContext, LoginActivity::class.java)
    startActivity(intent)
}
  1. Add the VFLiveChatFragment into your content .
VFLiveChatFragment liveChatFragment = VFLiveChatFragment.newInstance(getApplication(), "Container", metadata, this, vfSettings);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.live_chat_container, liveChatFragment);
ft.commit();