All Products
Search
Document Center

Object Storage Service:Installation (iOS SDK)

Last Updated:Nov 29, 2025

OSS SDK for iOS lets you programmatically manage resources in Object Storage Service (OSS). For example, you can manage buckets, upload objects, download objects, and process images. This topic describes how to install OSS SDK for iOS.

Prerequisites

  • iOS: iOS 8.0 or later is used.

  • macOS: macOS 10.10 or later is used.

Directly import the framework

For more information about how to generate a framework for OSS SDK for iOS, visit GitHub.

In Xcode, drag the framework to the required section of Target. In the dialog box that appears, select Copy items if needed.

Pod dependency

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 SDK for iOS framework.

pod 'AliyunOSSiOS'           
Note

You can add the framework or add the pod dependency.

Import the header file to your project

#import <AliyunOSSiOS/OSSService.h>            
Important

After importing the framework, add -ObjC to Other Linker Flags in the Build Settings of your project. If the -force_load option is set for the project, add -force_load <framework path>/AliyunOSSiOS.

Use the SDK in a Swift project.

OSS provides the Objective-C version of OSS SDK for iOS. In a Swift project, you can use the Objective-C version of the SDK for hybrid programming. OSS provides a demo that shows how to use the SDK in a Swift project. For more information, visit GitHub.

Compatible with IPv6-only networks

Domain name resolution in wireless networks is prone to hijackings. To address this issue, OSS SDKs for mobile devices support HTTPDNS for domain name resolution and directly use IP addresses to send requests to the OSS server. In an IPv6-only network, compatibility issues may occur. Apple has updated its App Store Review Guidelines to require apps to provide IPv6 compatibility. OSS SDK for iOS starts providing IPv6 support from V2.5.0. In OSS SDK for iOS V2.5.0 and later, aside from Objective-C settings, the following system libraries must be imported:

libresolv.tbd
CoreTelephony.framework
SystemConfiguration.framework            

About the ATS

At WWDC 2016, Apple announced that starting January 1, 2017, all apps in the App Store must enable the App Transport Security (ATS) feature. This means that by default, new app submissions cannot use NSAllowsArbitraryLoads to bypass ATS restrictions. In addition, all network requests from the app must be encrypted using HTTPS. Otherwise, the app may fail the review process.

The OSS SDK for iOS supports this in versions 2.6.0 and later. The SDK does not send any non-HTTPS requests. It also supports Endpoints that have a https:// prefix. You must set the correct HTTPS Endpoint to ensure that all network requests meet the requirements.

Important
  • When you set the Endpoint, use a URL with the https:// prefix.

  • Make sure that only HTTPS requests are initiated when you implement callbacks such as generating signature and obtaining tokens from Security Token Service (STS).