Skip to content

Release Notes

Suzie Hopkins edited this page Sep 16, 2020 · 25 revisions

This document includes a change log for the lia-core module.

Version 1.3.0

Version 1.3.0 of the Khoros Community Android SDK includes major updates and enhancements. Major changes include:

  • A new repository located here. We consolidated the three original the SDK repositories (core, ui, and example) into a single location.

  • A new root package name (lithium.community.android.sdk to com.lithium.community.android)

  • Better exception handling for REST API responses

  • Improved Javadoc documentation

  • Reduced SDK size

  • Improved initialization flow

  • Better API performance

  • Fixed crashes and bugs in the UI Support Library

  • Improved the usability of the demo application

  • Changed the variable names to make them more meaningful - Initialization now looks like this:

    try {
        LiAppCredentials credentials = new LiAppCredentials(
                          getString(R.string.clientName),
                          getString(R.string.clientId),
                          getString(R.string.clientSecret),
                          getString(R.string.tenantId),
                          getString(R.string.communityUrl),
                          getInstanceId(this)
                          );
        LiSDKManager.init(this, liAppCredentials);
    } catch (MalformedURLException | URISyntaxException | IllegalArgumentException e) {
        Log.e(LOG_TAG, "Couldn't initialize Lithium SDK");
    }

    Define the name in /res/values/strings.

    <string name="clientId">PLACE YOUR COMMUNITY CLIENT ID HERE</string>
    <string name="clientSecret">PLACE YOUR COMMUNITY CLIENT SECRET HERE</string>
    <string name="communityUrl">PLACE YOUR COMMUNITY URL HERE</string>
    <string name="tenantId">PLACE COMMUNITY TENANT ID HERE</string>
    <string name="clientName">PLACE CLIENT APP NAME HERE</string>

New methods

  • initialize(Context, LiAppCredentials): void

    Initializes the SDK. If the initialization is successful getInstance() will return an initialized SDK Manager. This function may or may not create a new instance or reinitialize the SDK Manager with subsequent calls. Replaces init(Context, LiAppCredentials): LiSDKManager.

  • isInitialized(): boolean

    Used to check whether the SDK is initialized correctly. Use this before invoking the core SDK APIs and components that depend on initialization. Returns true if the SDK is fully initialized, otherwise false. Replaces isEnvironmentInitialized(): boolean.

Deprecated methods

  • LiSDKManager

    • init(Context, LiAppCredentials): LiSDKManager
    • isEnvironmentInitialized(): boolean
    • getCoreSDKVersion(): String
    • getApiGatewayHost(): String
    • getCommunityUrl(): String
    • getLiAppCredentials(): LiAppCredentials
    • getNewAuthToken(): String
    • getProxyHost(): String
    • getTenant(): String
  • LiAppCredentials

    • getApiProxyHost(): String
    • getClientAppName(): String
  • LiAppCredentials.Builder

Version 1.2.5

  • We have decoupled SDK initialization from synching the Android app with the Community server. Previously, the app synched with Community as part of LiSDKManager init(android.content.Context context, LiAppCredentials liAppCredentials).

    As of 1.2.5, you now sync the app with the community after initialization but before making any Community REST API calls using LiSDKManager.getInstance().syncWithCommunity(context Context) either directly after initialization or in a different part of the app.

    To sync the app, make the following call: LiSDKManager.getInstance().syncWithCommunity(this);

Version 1.2.0

  • Device token ID for notification registration now passed when initiating the login flow

    Prior to 1.2.0, the SDK supported subscription notifications only through Firebase Cloud Messaging. We now enable customers to use other subscription notification services if desired. To use Lithium and Firebase for subscription notifications, developers now register a device for notification when initiating the login flow. Customers not using Firebase do not pass a device token. See details in Authenticating a user.

  • New parameter constructor for LiPostSubscriptionParams

    We added a second constructor to build parameters passed to the getSubscriptionPostClient(LiClientRequestParams liClientRequestParams) provider. Our original constructor required LiBaseModel, which is not always available. Our new constructor takes the subscription target ID and type. See details in Javadoc for LiClientRequestParams.LiPostSubscriptionParams for complete details.

Version 1.1.3

  • Set the client app name during initialization.

    You now set the Client App Name during initialization. Pass the Display Name defined for the app in the Display Name field in the Community Admin > System > API Apps tab. If you do not pass the Client App Name during initialization, it defaults to communityId-sdk.

    Initialization now looks like this:

    try {
        LiAppCredentials liAppCredentials = new LiAppCredentials.Builder()
                .setClientKey(getString(R.string.clientId))
                .setClientSecret(getString(R.string.clientSecret))
                .setCommunityUri(getString(R.string.communityURL))
                .setTenantId(getString(R.string.communityTenantId))
                .setApiProxyHost(getString(R.string.apiProxyHostname))
                .setClientAppName(getString(R.string.clientAppName)
                .build();
        LiSDKManager.init(this, liAppCredentials);
    } catch (MalformedURLException | URISyntaxException | IllegalArgumentException e) {
        Log.e(LOG_TAG, "Couldn't initialize Lithium SDK");
    }

    Define the name in /res/values/strings.

    <string name="clientId">PLACE YOUR COMMUNITY CLIENT ID HERE</string>
    <string name="clientSecret">PLACE YOUR COMMUNITY CLIENT SECRET HERE</string>
    <string name="communityURL">PLACE YOUR COMMUNITY URL HERE</string>
    <string name="communityTenantId">PLACE COMMUNITY TENANT ID HERE</string>
    <string name="clientAppName">PLACE CLIENT APP NAME HERE</string>

Version 1.1.2

Minor bug fixes and UI changes

Version 1.1.1

  • Customer delete provider We added a new API provider to perform custom Delete actions getGenericQueryDeleteClient(LiClientRequestParams liClientRequestParams) For details, see the Creating custom API providers section in API reference.

Version 1.1.0

  • Anonymous browsing support

    We now allow anonymous browsing via the Android SDK. If the action called cannot be performed by an anonymous user, the SDK returns a 401 error (Unauthorized). See Authentication with the Community Android SDK for an example for handling a 401 error.

  • Changes to initialization

    We have changed how to initialize the core SDK. To support anonymous browsing, you now set the tenant ID and API proxy host with LiAppCredentials.

    try {
      LiAppCredentials liAppCredentials = new LiAppCredentials.Builder()
          .setClientKey(getString(R.string.clientId))
          .setClientSecret(getString(R.string.clientSecret))
          .setCommunityUri(getString(R.string.communityURL))
          .setTenantId(getString(R.string.communityTenantId))
          .setApiProxyHost(getString(R.string.apiProxyHostname)).build();
      LiSDKManager.init(this, liAppCredentials);
    } catch (MalformedURLException | URISyntaxException | IllegalArgumentException e) {
      Log.e(LOG_TAG, "Couldn't initialize Lithium SDK");
    }
    

    The builder pulls the tenant ID and host name from strings.xml. Set the the ID and name in /res/values/strings.xml like this:

    <string name="communityTenantId">PLACE COMMUNITY TENANT ID HERE</string>
    <string name="apiProxyHostname">PLACE API PROXY HOSTNAME HERE</string>
    

    You can find your tenant ID and API proxy hostname in Community Admin > System > API Apps.

  • Changes to how we build a client

    We have changed how we build a client request. Previously you passed raw parameters to our provider clients. For example: getMessagesCilent(final String boardId).

    Starting with 1.10, you will pass parameters using the LiClientRequestParams class.

    In addition, we previously saved the Android context when the app was booted. To prevent stale context, as of 1.1.0, you’ll send the Android context whenever you build the client for a specific request. There is a specific call for each provider to get the context.

    Example: Get the latest messages from the community

    LiClientRequestParams liClientRequestParams = new LiClientRequestParams.LiMessagesClientRequestParams(getContext());
    LiClient client = LiClientManager.getMessagesClient(liClientRequestParams);
    

    Example: Get the latest messages from a particular board

    LiClientRequestParams liClientRequestParams = new 
    LiClientRequestParams.LiMessagesByBoardIdClientRequestParams(getContext(), selectedBoardId);
    LiClient client = LiClientManager.getMessagesByBoardIdClient(liClientRequestParams);
    
  • New utility methods

    We’ve added new utility methods:

    • LiSDKManager.getInstance().isUserLoggedIn() - determines whether the user is logged in or not
    • LiSDKManager.isEnvironmentInitialized() -determines whether the SDK is initialized
  • New providers

    We’ve added the following providers to LiClientManager:

    • getSubscriptionPostClient(LiClientRequestParams liClientRequestParams) - subscribe to a message
    • getMarkMessagePostClient(LiClientRequestParams liClientRequestParams) - mark a single message as read or unread
    • getMarkMessagesPostClient(LiClientRequestParams liClientRequestParams) - mark multiple messages as read or unread
    • getMarkTopicPostClient(LiClientRequestParams liClientRequestParams) - mark a topic message and all of its replies as read or unread
    • getCreateUserClient(LiClientRequestParams liClientRequestParams) - create a new user
    • getUpdateUserClient(LiClientRequestParams liClientRequestParams) - update a user account
    • getGenericPutClient(LiClientRequestParams liClientRequestParams) - new generic provider for PUT actions. Use LiGenericPutClientRequestParams(Context context, String path, JsonObject requestBody) to create the parameters
  • Renamed providers We have renamed several providers for consistency.

    • createGenericPostClient(String path, JsonObject responseBody) is now getGenericPostClient(LiClientRequestParams liClientRequestParams)

Version 1.0.2