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:
Connect your project to mPaaS:
Import the Security Guard image
yw_1222.jpgfor 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.
In Xcode, choose Editor > mPaaS > Edit Project to open the project editor.
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.
In your Podfile, add the
mPaaS_pod "mPaaS_RPC"dependency for the Mobile Gateway component.
Run
pod installfrom the command line to complete the integration.