SDK upgrade

更新时间:
复制 MD 格式

If you are using an outdated version of the app SDK, you must upgrade it to the latest version.

Overview

The latest app SDK released by IoT Platform is API Level 10. The following table describes the differences between SDK versions. For more information, see API Level versions.

Category

API Level 7 and earlier SDKs

API Level 8 SDK

API Level 9 SDK

API Level 10 SDK

Initialization

Each SDK is initialized separately.

Unified initialization

Unified initialization

Unified initialization

Security image

Four images (for the former Alibaba Cloud China Website and International Website, and for the former beta and official versions)

Two images (for the former Alibaba Cloud China Website and International Website)

One image (globally applicable)

No security image required

Operation when switching the app between the Chinese mainland and regions outside the Chinese mainland

Switch the security image and restart the app.

Switch the security image and restart the app.

No operation required

No operation required

Several upgrade plans are available. Choose the one that fits your needs.

Current SDK integration status

Upgrade plan

No SDK version is integrated

Use the latest SDK version and initialize it. This is considered a new integration, not an upgrade. For more information, see Download and integrate the SDK and Initialize the SDK.

API Level 9 SDK is integrated

To replace the security image or create a new app, upgrade the SDK by following the API Level 9 SDK upgrade plan. Securely store the key that is generated by the platform.

API Level 8 SDK is integrated

Upgrade the SDK by following the API Level 8 SDK upgrade plan. Note the following for future project management. For information about the potential impact of the upgrade, see Global Activation Center update announcement.

  • If you have created projects on both the Alibaba Cloud China and international sites, and one of the projects has a low shipment volume or no shipments

    After the upgrade, use the project with more shipments as the main project, where you will manage your products and apps. Share the products from the other project with the app in the main project. This lets you maintain the app in a single project. For more information about sharing products across projects, see Associate products.

  • If you have created projects on both the former Alibaba Cloud China and International websites, and their business volumes are so similar that you cannot decide which one to prioritize

    After the upgrade, you can manage the products and apps in both projects by manually modifying the security image suffix and calling an API to switch the security image.

API Level 7 or earlier SDK is integrated

Two upgrade plans are available.

  • Upgrade the API Level 7 SDK and use the unified initialization plan (Recommended)

    The unified initialization plan is better for adding new features and expanding to markets outside China. We recommend that you upgrade to the latest SDK and use this plan.

  • Upgrade the API Level 7 SDK without using the unified initialization plan (Not recommended)

    You can keep the previous initialization method and only update the SDK version. However, this method does not support global unified activation. Choose this plan with caution.

API Level 9 SDK upgrade plan

  1. Go to the SDK and plugins page for your app. Select the latest API Level 10 and download the new SDK package. For more information, see Download and integrate the SDK.

    The downloaded file is a compressed package. After you decompress it, you will find the dependency.gradle file.

  2. Use the unified initialization API to initialize the SDK. For more information, see Initialize the SDK.

  3. (Optional) Add the customization logic from the previous SDK, such as custom UIs for user accounts.

API Level 8 SDK upgrade plan

  1. Go to the SDK and plugins page for your app. Select the latest API Level 9 and download the new SDK package. For more information, see Download and integrate the SDK.

    Decompress the downloaded package. The folder contains a security image and the Podfile file.

  2. Use the new unified initialization API to initialize the SDK. For more information, see Initialize the SDK.

  3. (Optional) Add the customization logic from the previous SDK, such as custom UIs for user accounts.

  4. (Optional) Set the security image suffix.

    To manage apps from two projects at the same time, you must set different security image suffixes.

    1. Copy and rename the security image. For example, name it yw_1222_xxxyyy.jpg.

    2. Add the business logic to call and switch security images.

      [[IMSIotSmart sharedInstance] setAuthCode:@"xxxyyy"] 
      //xxxyyy is the suffix of the renamed security image.
      //If authCode is not set or is empty, the app loads the security image named yw_1222_china_production.jpg by default.

      You must implement the timing and logic for switching the security image. The app must be restarted for the change to take effect.

Upgrade the API Level 7 SDK and use the unified initialization plan (Recommended)

  1. Go to the SDK and plugins page for your app. Select the latest API Level 9 and download the new SDK package. For more information, see Download and integrate the SDK.

    Decompress the downloaded package. The folder contains a security image and the Podfile file.

  2. Delete the initialization-related code from your current app project. This includes the code for initializing the API channel SDK, account and user SDK, and identity authentication SDK.

  3. Use the new unified initialization API to initialize the SDK. For more information, see Initialize the SDK.

  4. (Optional) Add the customization logic from the previous SDK, such as custom UIs for user accounts.

Upgrade the API Level 7 SDK without using the unified initialization plan (Not recommended)

Note

This upgrade plan does not support global unified activation. Therefore, choose this plan with caution.

  1. Go to the SDK and plugins page for your app. Select the latest API Level 9 and download the new SDK package. For more information, see Download and integrate the SDK.

    Decompress the downloaded package. The folder contains a security image and the Podfile file.

  2. In your code-based project, replace the SDK version number in the original Podfile with the version number from the newly downloaded Podfile.