Add the SDK

更新时间:
复制 MD 格式

This topic describes how to add the Mobile Gateway component to an iOS client. Mobile Gateway supports three connection types: based on the mPaaS framework, based on an existing project using the mPaaS plugin, and based on an existing project using CocoaPods. For more information, see Introduction to connection types. Choose a connection type that meets your needs.

Prerequisites

Before you add the Mobile Gateway SDK, complete the following tasks:

  1. Connect your project to mPaaS:

  2. Import the Security Guard image yw_1222.jpg for request signing:

    • Public cloud: After you complete Step 1, a Security Guard image is automatically generated in the project. No further action is required.

    • Apsara Stack: Generate the Security Guard image. For more information, see Generate a Security Guard image.

Add the SDK

Choose a method to add the SDK based on your connection type.

Use the mPaaS Xcode Extension

Use this method if your project is connected based on the mPaaS framework or based on an existing project using the mPaaS plugin.

  1. In Xcode, choose Editor > mPaaS > Edit Project to open the project editor.

  2. Select Mobile Gateway, save the configuration, and then click Start Editing to add the component.

Use the cocoapods-mPaaS plugin

Use this method if your project is connected based on an existing project using CocoaPods.

  1. In your Podfile, add the mPaaS_pod "mPaaS_RPC" dependency for the Mobile Gateway component. mgs_pod

  2. Run pod install from the command line to complete the integration.

What to do next

Use the SDK