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.
|
API Level 7 or earlier SDK is integrated | Two upgrade plans are available.
|
API Level 9 SDK upgrade plan
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.
Use the unified initialization API to initialize the SDK. For more information, see Initialize the SDK.
(Optional) Add the customization logic from the previous SDK, such as custom UIs for user accounts.
API Level 8 SDK upgrade plan
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.
Use the new unified initialization API to initialize the SDK. For more information, see Initialize the SDK.
(Optional) Add the customization logic from the previous SDK, such as custom UIs for user accounts.
(Optional) Set the security image suffix.
To manage apps from two projects at the same time, you must set different security image suffixes.
Copy and rename the security image. For example, name it
yw_1222_xxxyyy.jpg.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)
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.
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.
Use the new unified initialization API to initialize the SDK. For more information, see Initialize the SDK.
(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)
This upgrade plan does not support global unified activation. Therefore, choose this plan with caution.
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.
In your code-based project, replace the SDK version number in the original Podfile with the version number from the newly downloaded Podfile.