Migrating from 1.x to 2.0

This page covers the key changes you'll need to make to your app to upgrade from a 1.x version of the Support SDK to 2.0.

Update the artifact name

With 2.0, the artifact name has changed from sdk to support. The correct dependency Gradle snippet now looks like this:

implementation group: 'com.zendesk', name: 'support', version: '2.0.0'

If you're using the API providers artifact, the name has changed from sdk-providers to support-providers:

implementation group: 'com.zendesk', name: 'support-providers', version: '2.0.0'

Update the initialization call

Previously, you initialized the SDK using the ZendeskConfig singleton. In 2.0, we have split out the responsibilities of the SDK into two separate enum singletons that must both be initialized separately. Initialize the Zendesk enum singleton with your account details first, and then initialize the Support enum singleton as follows:

import zendesk.core.Zendesk;
import zendesk.support.Support;

Zendesk.INSTANCE.init(context, zendeskUrl, applicationId,
        oauthClientId);
Support.INSTANCE.init(Zendesk.INSTANCE);

For more information, see Initializing the Support SDK.

Update the identity

The mechanism for setting an identity is unchanged in 2.0, but the identity classes have moved, and the setIdentity method is on Zendesk rather than the old ZendeskConfig.

Setting an anonymous identity:

import zendesk.core.Zendesk;
import zendesk.core.AnonymousIdentity;

Identity identity = new AnonymousIdentity();
Zendesk.INSTANCE.setIdentity(identity)

Setting a JWT identity:

import zendesk.core.Zendesk;
import zendesk.core.JwtIdentity;

JwtIdentity identity = new JwtIdentity(myJwtTokenString);
Zendesk.INSTANCE.setIdentity(identity);

For more information, see Setting an identity.

Update the Activity names

All the Activity classes have been renamed, moved, or completely rewritten. Update your references using the table below.

1.x Activity name 2.0 Activity name Feature
com.zendesk.sdk.support.SupportActivity zendesk.support.guide.HelpCenterActivity Browse and search Help Center content
com.zendesk.sdk.support.ViewArticleActivity zendesk.support.guide.ViewArticleActivity View an individual Help Center article
com.zendesk.sdk.feedback.ui.ContactZendeskActivity zendesk.support.request.RequestActivity Create a new ticket in Support
com.zendesk.sdk.requests.ViewRequestActivity zendesk.support.request.RequestActivity View and update a ticket in Support
com.zendesk.sdk.requests.RequestActivity zendesk.support.requestlist.RequestListActivity View a list of the user's tickets

Note The Rate My App feature was deprecated in 1.10, removed in 1.11, and is not present in 2.0. To continue using the feature, consider using our open source replacement.

Update the way you start SDK activities

We implemented a builder-based pattern for starting and configuring all our SDK activities in 2.0. All previous methods for starting our activities should be replaced with the builders, as detailed in Configuring the SDK activities.

Update the provider references

All our provider classes have moved. Some are now accessed through the Support singleton:

import zendesk.support.Support;
import zendesk.support.HelpCenterProvider;
import zendesk.support.RequestProvider;
import zendesk.support.UploadProvider;

    HelpCenterProvider helpCenterProvider = Support.INSTANCE.provider().helpCenterProvider();

    RequestProvider requestProvider = Support.INSTANCE.provider().requestProvider();

    UploadProvider uploadProvider = Support.INSTANCE.provider().uploadProvider();

Some are now accessed through the Zendesk singleton:

import zendesk.core.Zendesk;
import zendesk.core.UserProvider;
import zendesk.core.PushRegistrationProvider;

    UserProvider userProvider = Zendesk.INSTANCE.provider().userProvider();

    PushRegistrationProvider pushRegistrationProvider = Zendesk.INSTANCE.provider().pushRegistrationProvider();

Update push notification handling and deep-linking

If you previously used the ZendeskDeepLinking.INSTANCE.refreshRequest method, replace it with Support.INSTANCE.refreshRequest.

If you previously used ZendeskDeepLinking to obtain a deep-link Intent, replace it with the RequestActivity's builder:

new RequestUiConfig.Builder()
    .withRequestId(requestId)
    .deepLinkIntent(getApplicationContext());

Where to next?

Now that you've completed these steps, your app should be building and running with version 2.0 of the Support SDK. To take advantage of the latest features, try out our new configuration options.