This topic describes how to install the OSS SDK for iOS.
- iOS V8.0 and later
- macOS version: 10.10 and later
Directly import the framework
For more information about how to obtain the OSS iOS SDK framework, see GitHub.
In Xcode, drag the framework and drop it to your required section. In the dialog box that appears, select Copy items if needed.
If your project uses Cocoapods to manage dependencies, add the following dependency to the Podfile. In this case, you do not need to import the OSS iOS SDK framework.
Import the header file to your project
Other Linker Flagsof
Build Settingsin your project. If the
-force_loadoption is configured for your project, add
-force_load <framework path>/AliyunOSSiOS.
Compatible with IPv6-only networks
Domain name resolution in wireless networks is subject to hijackings. To address this issue, OSS SDKs for mobile devices imports HTTPDNS for domain name resolution and directly uses IP addresses to request the OSS server. In an IPv6-only network, compatibility issues may occur. Apple has officially issued the review requirements for applications, which requires applications to be IPv6-only network compatible. To meet this requirement, the SDK starts to be compatible from V2.5.0. In the later version, aside from -ObjC settings, two system libraries must be imported:
libresolv.tbd CoreTelephony.framework SystemConfiguration.framework
About the ATS policy of Apple
During WWDC 2016, Apple announced that all the applications in Apple App Store must implement App Transport Security (ATS) from January 1, 2017. In other words, all newly submitted applications are not allowed to use
NSAllowsArbitraryLoads to bypass the ATS limitation. Additionally, the application submitters must make sure that all network requests from the application are encrypted by using HTTPS. Otherwise, the application may fail the review.
The OSS iOS SDK V
2.6.0 and later provide the support for this ATS policy. The SDK sends only HTTPS requests. The SDK supports the prefix of
https:// in the
Endpoint field value. You need only to set the correct HTTPS
Endpoint field. In this way, all network requests can meet the requirements.
- When you set the
Endpointfield, you must use the URL that is prefixed with
- Make sure that the application initiates only HTTPS requests when when you implement callbacks such as signing and obtaining STS tokens.