LiveLike

The LiveLike Developer Hub

Welcome to the LiveLike developer hub. You'll find comprehensive guides and documentation to help you start working with LiveLike as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Getting Started

Get a basic integration up and running with the Android SDK

This is a developers' guide for setting up Android Engagement SDK configuration for native Android apps. We will take you through the basic technical steps for configuration and show you how to send your first widgets and chat messages. We will also provide detailed samples and instructions for complete LiveLike integration.

Prerequisites

  • An admin login and registered application on the Producer Suite
  • Client ID - Used to initialize the SDK. To get your ClientID, register your application in the Producer Suite
  • Minimum OS: Android 4.1
  • Minimum Android SDK: Jelly Bean SDK 16

🚧

Android X Support

The Android Engagement SDK is using the Support Libary 28 which are binary equal to Android X binaries.

If you have any issues with the integration using Android X please reach out.

Installation

👍

Current Version is 2.6.3

Step 1
Add the JitPack repository to your build file

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
<repositories>
  <repository>
    <id>jitpack.io</id>
      <url>https://jitpack.io</url>
  </repository>
</repositories>
resolvers += "jitpack" at "https://jitpack.io"
:repositories [["jitpack" { :url "https://jitpack.io" }]]

Step 2
Add the dependency

implementation 'com.livelike.android-engagement-sdk:engagementsdk:<<android-current-version>>'
<dependency>
  <groupId>com.livelike.android-engagement-sdk</groupId>
  <artifactId>engagementsdk</artifactId>
  <version> <<android-current-version>> </version>
</dependency>
libraryDependencies += "com.livelike.android-engagement-sdk" % "engagementsdk" % "<<android-current-version>>"
:dependencies [[com.livelike.android-engagement-sdk/engagementsdk " <<android-current-version>> "]]

Initialization

For this step, you will need your Client ID to initialize the Android Engagement SDK. See here to retrieve your Client ID.

The LiveLike SDK generates a User whenever it is initialized. You can choose to either store it locally or persist it within your internal user database. See Profiles for more info.

val userAccessToken = yourClass.retrieveUserToken(); // Your method to retrieve a user token from your local or persistent storage

if (userAccessToken == null) {
  val engagementSDK = EngagementSDK(LIVELIKE_CLIENT_ID, applicationContext)
    engagementSDK.userStream.subscribe("_"){
        it?.let { yourClass.persistUserToken(it.accessToken) }  // Your method to persist a user token in your local or persistent storage
    }
} else {
  val engagementSDK = EngagementSDK(LIVELIKE_CLIENT_ID, applicationContext,userAccessToken)
}
if (userAccessToken == null) {
  LiveLikeSDK engagementSDK = new LiveLikeSDK(BuildConfig.LIVELIKE_CLIENT_ID, applicationContext);
  engagementSDK.getUserStream.subscribe("key",new Function1<LiveLikeUserApi, Unit>() {
    @Override
    public Unit invoke(LiveLikeUserApi liveLikeUserApi) {
      return yourClass.persistToken(liveLikeUserApi.getAccessToken()); // Your method to persist a user token in your local or persistent storage
    }
  }
} else {
  LiveLikeSDK engagementSDK = new LiveLikeSDK(BuildConfig.LIVELIKE_CLIENT_ID, applicationContext, userAccessToken);
}

Configure Your Layout

Now you have to configure your media page layout and declare containers for the Android Engagement SDK Widget and Chat views to live inside.

📘

Even though this guide makes use of both the chat and widget components, if desired it is possible to use only one of the components.

🚧

The width of the Widget view must be at least 292dp and the width of the Chat view must be at least 292dp.

Add the following to your layout XML

<com.livelike.engagementsdk.chat.ChatView
    android:id="@+id/chat_view"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:displayUserProfile="true"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"/>
            
<com.livelike.engagementsdk.widget.view.WidgetView
    android:id="@+id/widget_view"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"/>

Notes:

  • The displayUserProfile boolean property is used to control the display of user profile bar above chat input box.
  • Properties of the view can be set via XML or programmatically.

Start a Content Session

A Content Session represents a user's subscription to a particular program (typically a live, linear TV show, game, or episode). To start a Content Session you will need a Program ID. Integrating teams are expected to create programs within the LiveLike system, either through the API or through the Producer Suite. The team should then copy the Program IDs into the relevant media metadata in their own systems so that content sessions can be started along with media playback.

How to retrieve a Program ID:

How to publish a widget:

Starting a Content Session

val contentSession = engagementSDK.createContentSession("<program-id >")
widget_view.setSession(contentSession)
chat_view.setSession(contentSession.chatSession)
ContentSession session = engagementSDK.createContentSession("<program-id>");
WidgetView widgetView = findViewById(R.id.widgetView);
widgetView.setSession(session);
ChatView chatView = findViewById(R.id.chatView);
chatView.setSession(session);

Handling application going to background

When your application goes to background the Android Engagement SDK is still listening for new widgets to make sure the user doesn't lose any of the action when coming back.

If you want to disable this feature and assure the application remains dormant when backgrounded, you will need to Pause and Resume the Content Session.

// When going to background
contentSession.pause()

// When coming back from background 
contentSession.resume()

// When exiting your activity
contentSession.close()
// When going to background
contentSession.pause();

// When coming back from background 
contentSession.resume();

// When exiting your activity
contentSession.close();

Updated 22 days ago

Getting Started


Get a basic integration up and running with the Android SDK

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.