Install the SDK Package
Installation steps
- Download the SDK compression package from the Official Website.
- Extract the contents to obtain the frameworks. The frameworks consist of three parts: Basic, BOS, and STS. Among these, Basic and BOS are mandatory, while STS is optional based on your need for temporary authorization.
- Copy the framework into the lib directory or another relevant location within your Xcode project folder, based on your requirements.
- Right-click on the Xcode project, choose "Add files to 'your project'," and import the copied framework.
- In the Build Settings, add -ObjC to the Other Linker Flags option.
Configure App Transport Security (ATS)
Note: If BOS uses an HTTPS endpoint, there's no need to configure ATS settings. ATS configuration in the info.plist file is only required for HTTP endpoints.
Starting from iOS 9.0 and OS X v10.11, the App Transport Security (ATS) feature is enabled by default. ATS enforces the use of HTTPS to access web services and must use TLS v1.2 or higher to ensure communication security. For detailed requirements of ATS, please refer to: Requirements for Connecting
If the App supports iOS 9.0 and needs to access web services that do not meet the above requirements, exception handling rules must be added using the NSAppTransportSecurity element in the info.plist file. For the usage of NSAppTransportSecurity, please refer to: App Transport Security
SDK directory structure
1Baidu-BOS-SDK-iOS-v1.0.0
2 |_BaiduBCEBasic.framework // Basic module
3| |____Headers
4 | |____BCEClient.h // BCE service base class
5 | |____BCEClientConfiguration.h // BCE service configuration base class
6 | |____BCECredentials.h // BCE AK, SK signature class
7 | |____BCEError.h // BCE general error codes
8 | |____BCERegion.h // Regions where BCE provides services
9 | |____BCERequest.h // BCE network request class
10 | |____BCEResponse.h // BCE network response class
11 | |____BCEResponseMetadata.h // BCE network response metadata class
12 | |____BCESTSCredentials.h // BCE temporary authorization signature class
13 | |____BCETask.h // BCE general task class
14|
15 |_BaiduBCEBOS.framework // BOS module
16| |____Headers
17 | |____BOSClient.h // BOS client entry class
18 | |____BOSClientConfiguration.h // BOS-specific Client configuration
19 | |____BOSListBucketModel.h // Classes related to listing Buckets
20 | |____BOSGetOBjectModel.h // Classes related to downloading Objects
21| |____ .
22| |____ . // ...
23| |____ .
24 | |____BOSPutObjectModel.h // Classes related to uploading Objects
25|
26 |_BaiduBCESTS.framework // STS authorization module
27| |____Headers
28 | |____STSClient.h // STS service entry class
29 | |____STSClientConfiguration.h // STS-specific Client configuration
30 | |____STSGetSessionTokenModel.h // Classes related to obtaining tokens
