# Integrate the SDK package for iOS

> This topic covers how to easily integrate the iOS SDK package with CocoaPods and by manual integration.

This topic covers how to easily integrate the iOS SDK package with CocoaPods and by manual integration. Before beginning the integration, ensure that you have completed the following environment preparations:

-   Install Xcode 12 or later.
-   Use iOS 11 or later.

## Use CocoaPods

Please follow the steps below to integrate the SDK package with CocoaPods.

1.  Update the ._netrc_ file:

For security reasons, Antom SDK uses a private CocoaPods source to distribute the pods. To gain access to the private source, you need to update your _.netrc_ file which holds the required credentials. Copy the code snippet below to update your _.netrc_ file.

The _.netrc_ file is located in the _~/.netrc_ directory, if it does not exist, you need to create a _.netrc_ file. Refer to the [.netrc file](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html) for more information.

```plaintext
machine globaltech.alipay.com
login antomsdk@aliyun.com
password Admin1234
```

2.  Add the private source and dependency to your _Podfile_:

Antom provides you with multiple integration package options. Use the corresponding code snippet to add CocoaPods private source and dependencies to your _Podfile_.

-   (Required) SDK package

```ruby
source 'https://globaltech.alipay.com/api/v1/file/common/5700989804217335/antom'

target 'YOUR_TARGET' do

  pod 'AMSComponent'

end
```

-   (Optional) SDK security package

> **Note**: If you are integrating the EasySafePay, please install this security package.

```ruby
source 'https://globaltech.alipay.com/api/v1/file/common/5700989804217335/antom'

target 'YOUR_TARGET' do

  pod 'AMSComponent'
  pod 'AMSSecurity'

end
```

-   Apple Pay package (Optional): When you need to integrate Apple Pay, use the following code snippet. The Apple Pay package can be used in conjunction with the security package.

```ruby
source 'https://globaltech.alipay.com/api/v1/file/common/5700989804217335/antom'

target 'YOUR_TARGET' do

  pod 'AMSComponent'
  pod 'AMSApplePay'

end
```

## Integrate manually

If you are not using CocoaPods integration, you can follow the manual integration method provided by Antom.

1.  Download the latest SDK package in [Alipay Global Partner Developer Center](https://global.alipay.com/open/console/developer/app/list?_route=SG):

Go to **Resources > Download** **Detail** **\> iOS**, select the corresponding product package, and click on **View the download address of this package** to download. Accept the download agreement for the first download.

2.  Add the frameworks:

Add the following frameworks to your project:

#### Tab: Basic package

SDK package framework:

-   _AMSComponent.xcframework_
-   _AlipayWebView.xcframework_

#### Tab: Expansion package

SDK security package framework:

-   _APPSecuritySDKAdapter.framework_
-   _APPSecuritySDKCore.framework_

Apple Pay package framework:

-   _AMSApplePay__.xcframework_

Go to **Build Phases** > **Copy Bundle Resources** > **Add Other**, add the following frameworks:

-   _AMSComponent.xcframework/ios-arm64/AMSComponent.framework/AMSComponent.bundle_
-   _AlipayWebView.xcframework/ios-arm64/AlipayWebView.framework/IWebContainer.bundle_

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/df33e0ee-d695-46fd-a2a3-d2cf6406c6b6.png)

![ios2.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/9d00e34b-8dee-4fce-90b1-6a7d9a5d71d8.png)

3.  Go to **Build Settings** > **Linking** > **Other Linker Flags** to add _\-ObjC_.

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/1710213869294-61d2ca3d-d367-4fa4-8f20-a23cd1716ea3.png)

## Integrate the security extension package

Integrating the security extension package can enhance security performance and reduce security challenges in the payment process. To integrate the security SDK (whether via CocoaPods or manual integration), go to **Build Settings** > **Linking** > **Other Linker Flags** to add _\-Wl,-no\_fixup\_chains_.

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/d1dfc6c6-4320-437b-9e74-af7b7f736bba.png)

## Integrate Alipay

> **Note**: Currently, only EasySafePay supports integrating with Alipay.

1.  Add the **URL Schemes** configuration to the main project _Info.plist_ file:

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/1718954376676-6a770c7b-f695-4f87-8f04-97cd5d8b7aa2.png)

2.  Integrate the AlipaySDK-iOS package:

a. Launch your IDE (such as Xcode). Add the _AlipaySDK.framework_ file from the iOS package to your project directory.

b. On the **Build Phases** project tab, click **Link Binary With Libraries**, and add the Alipay SDK dependencies.

![Alipay SDK 依赖库en.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/930b03fa-429e-4234-9381-e7f05d054e32.png)

c. Go to **Build Phases** > **Copy Bundle Resources** > **Add Other**, add _AlipaySDK.framework_/_AlipaySDK.bundle_.

![11.jpg](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/jpg/da795e95-a142-4d95-be83-000b067bea9c.jpg)

![Alipay SDK 依赖库1.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/e1c71f49-c73b-44a2-80b1-37309f0fb070.png)