Skip to main content

Upgrading from 3.x to 4.x

Important

Helpshift’s Legacy SDKs (SDK Version <=7.x.x) will see end of life as of 31 Dec 2022 and end of support as of 31 March 2023.

Upgrading from 3.x to 4.x

The Helpshift SDK v4.x is a major update and we have moved all Helpshift support APIs to a new namespace. If you have questions or feedback, please Contact Us

Upgrading​

When migrating from the Helpshift SDK 3.12.0 or older, you will need to take care of the following changes -

  1. Changes in Helpshift Delegate

    • com.helpshift.HelpshiftDelegate has been renamed to com.helpshift.support.Delegate.
    • helpshiftSessionBegan() method of the delegate is renamed to sessionBegan()
    • helpshiftSessionEnded() method of the delegate is renamed to sessionEnded()
  2. Changes in HSAlertToRateAppListener

    • HSAlertToRateAppListener has been renamed to AlertToRateAppListener
    • Helpshift.HS_RATE_ALERT enum has been replaced with integer. Now you have to use the final integers from the RateAlert class.

    For example,

    AlertToRateAppListener actionListener = new AlertToRateAppListener() {
    @Override
    public void onAction(int action) {
    String msg = "";
    switch (action) {
    case Support.RateAlert.CLOSE:
    msg = "CLOSE";
    break;
    case Support.RateAlert.FEEDBACK:
    msg = "FEEDBACK";
    break;
    case Support.RateAlert.SUCCESS:
    msg = "SUCCESS";
    break;
    case Support.RateAlert.FAIL:
    msg = "FAIL";
    break;
    }
    Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
    }
    }
  3. Now the ENABLE_CONTACT_US enum has been replaced with integer. Now you have to use the final integer from the EnableContactUs class.

    For example,

    HashMap config = new HashMap ();
    config.put("enableContactUs", Helpshift.EnableContactUs.ALWAYS);
    Helpshift.showFAQs(MyActivity.this, config);
  4. Changes in HSCallable

    • HSCallable has been renamed to Callable

    For example,

    Support.setMetadataCallback(new Callable() {
    public HashMap call() {
    k.put("userType", preferences.getString("customMetaId_userType", ""));
    k.put("timestamp", ts.format(new Date()));
    String[] tags = preferences.getString("customTags", "").split(",");
    k.put(Support.TagsKey, tags);
    return k;
    }

List of API changes​

3.x APINew API
Helpshift.install(...);Core.init(Support.getInstance());
Core.install(...)
Helpshift.showFAQs(...);Support.showFAQs(...);
Helpshift.showSingleFAQ(...);Support.showSingleFAQ(...);
Helpshift.showFAQSection(...);Support.showFAQSection(...);
Helpshift.showConversation(...);Support.showConversation(...);
Helpshift.setNameAndEmail(...);Core.setNameAndEmail(...);
Helpshift.registerDeviceToken(...);Core.registerDeviceToken(...);
Helpshift.handlePush(...);Core.handlePush(...);
Helpshift.login(...);Core.login(...);
Helpshift.logout(...);Core.logout();
Helpshift.clearBreadCrumbs();Support.clearBreadCrumbs();
Helpshift.getNotificationCount(...);Support.getNotificationCount(...);
Helpshift.leaveBreadCrumb();Support.leaveBreadCrumb();
Helpshift.setDelegate(...);Support.setDelegate(...);
Helpshift.setMetadataCallback(...);Support.setMetadataCallback(...);
Helpshift.setSDKLanguage(...);Support.setSDKLanguage(...);
Helpshift.setUserIdentifier(...);Support.setUserIdentifier(...);
Helpshift.showAlertToRateApp(...);Support.showAlertToRateApp(...);
Helpshift.HSTagsKeySupport.TagsKey
Helpshift.HSCustomMetadataKeySupport.CustomMetadataKey