All Products
Search
Document Center

Mobile Platform as a Service:Integrate mPaaS into an existing project using CocoaPods

Last Updated:Jan 30, 2026

This topic describes how to quickly integrate mPaaS by generating configurations using the CocoaPods native plugin extension.

Prerequisites

  • You have installed CocoaPods 1.0.0 or later. For more information, see CocoaPods. Your project must be a CocoaPods project.

  • You have installed the Cocoapods-mPaaS plugin. If you have not installed the plugin, run the following command to install it.

    sh <(curl -s http://mpaas-ios.oss-cn-hangzhou.aliyuncs.com/cocoapods/installmPaaSCocoaPodsPlugin.sh)
  • You have created an application in the console and downloaded the .config configuration file. For more information, see Create an application in the console.

Integration steps

  1. Copy the .config configuration file to the root directory of your project. This directory is the same as the one that contains the Podfile.

    Note

    Ensure that the downloaded .config file name ends with iOS. If it ends with ios, you must manually change it to iOS.

  2. In the command line, run the pod mpaas init command. This command automatically processes the Podfile and adds the plugin, source, and mPaaS_baseline configurations. The automatically configured code is as follows:

     plugin "cocoapods-mPaaS"
     source 'https://gitee.com/mpaas/podspecs.git'
     mPaaS_baseline 'x.x.x'
  3. Configure the Podfile file.

    1. Specify the mPaaS baseline by modifying mPaaS_baseline. For example, mPaaS_baseline '10.2.3', where 10.2.3 is the baseline version number. For information about the differences between versions, see Release notes.

    2. Add mPaaS component dependencies using mPaaS_pod. For example, mPaaS_pod "mPaaS_Nebula", where mPaaS_Nebula is the component name. For a list of component names, see the component list below.

      Component configuration

      Applicable baseline

      Description

      mPaaS_pod "mPaaS_LocalLog"

      10.1.32+

      Local log

      mPaaS_pod "mPaaS_Log"

      10.1.32+

      Mobile Analysis Service: Analyzes behavior logs, automated logs, crash logs, and performance logs.

      mPaaS_pod "mPaaS_Diagnosis"

      10.1.32+

      Diagnosis: Client-side diagnostic analysis.

      mPaaS_pod "mPaaS_RPC"

      10.1.32+

      Mobile Gateway Service: Provides features such as download, upload, and remote procedure calls (RPC).

      mPaaS_pod "mPaaS_Sync"

      10.1.32+

      Mobile Sync Service: Persistent connection service.

      mPaaS_pod "mPaaS_Push"

      10.1.32+

      Message Push Service

      mPaaS_pod "mPaaS_Config"

      10.1.32+

      Configuration Switch: Pulls the corresponding value from the server based on a key to dynamically control client logic.

      mPaaS_pod "mPaaS_Upgrade"

      10.1.32+

      Upgrade and release: Provides a service for proactive upgrade checks. Use it for canary releases and online new version notifications.

      mPaaS_pod "mPaaS_Share"

      10.1.32+

      Share: Supports sharing text and images to popular channels such as Weibo, DingTalk, and Alipay friends.

      mPaaS_pod "mPaaS_Nebula"

      10.1.32+

      HTML5 container and offline packages: The Nebula container supports interaction between the frontend and native code.

      mPaaS_pod "mPaaS_UTDID"

      10.1.32+

      Device ID: Quickly obtains a device ID to help applications securely and effectively identify specific devices.

      mPaaS_pod "mPaaS_DataCenter"

      10.1.32+

      Datacenter: Provides secure, fast, and encryptable key-value (KV) storage that supports multiple data types. It also offers various persistence solutions, such as database Data Access Object (DAO) support.

      mPaaS_pod "mPaaS_ScanCode"

      10.1.32+

      Scan Code: Quickly recognizes QR codes and barcodes.

      mPaaS_pod "mPaaS_LBS"

      10.1.32+

      Location Based Service: A location solution for mobile clients.

      mPaaS_pod "mPaaS_CommonUI"

      10.1.32+

      Common UI: A library of common user interface (UI) components.

      mPaaS_pod "mPaaS_BadgeService"

      10.1.32+

      Badge Service: A client-side "red dot" notification component. It supports notification styles such as dots, numbers, and "New". It also automatically manages hierarchical badge relationships.

      mPaaS_pod "mPaaS_Multimedia"

      10.1.32+

      Multimedia component: Supports features such as image download, upload, and caching.

      mPaaS_pod "mPaaS_MobileFramework"

      10.1.32+

      Mobile Framework: A client application framework. It manages sub-apps, multi-tab applications, third-party redirects, viewController transitions, and exception handling and reporting.

      mPaaS_pod "mPaaS_OpenSSL"

      10.1.32+

      OpenSSL

      mPaaS_pod "mPaaS_TinyApp"

      10.1.32+

      Mini Program: Provides the capability to integrate and publish miniapps.

      mPaaS_pod "mPaaS_CDP"

      10.1.32+

      Mobile Content Delivery Platform: Provides intelligent and dynamic delivery of a variety of marketing advertisements and display formats to the client.

      mPaaS_pod "mPaaS_ARTVC"

      10.1.68

      Audio and Video Call: An audio and video call component. It supports two-party and multi-party video calls and online meetings.

      mPaaS_pod "mPaaS_BlueShield"

      10.2.3+

      BlueShield encryption component: Add the absBase64Code parameter to the config file to automatically generate a BlueShield image.

      mPaaS_pod "mPaaS_MDC"

      10.2.3+

      Mobile Dispatch Component (MDC): Fine-grained domain name policy scheduling.

      The following shows a complete Podfile example:

      image.png

  4. Run pod mpaas update x.x.x, where x.x.x is the configured baseline number, such as 10.2.3.

  5. Run pod install to complete the integration. You can also append --verbose to view detailed logs.

    Note

    If you receive a message that a library from the official GitHub website cannot be found when you run pod install, specify the official GitHub source address at the top of your Podfile: https://github.com/CocoaPods/Specs.git.

  6. If you encounter third-party library conflicts after the integration, remove the conflicting libraries. For more information, see Handle iOS conflicts.

Upgrade guide

When a new version of mPaaS is released, you can upgrade individual components or the entire baseline, which is the SDK version.

Upgrade components

  1. In the command line, run pod mpaas update x.x.x, where x.x.x is the current baseline version number, such as 10.2.3.

    Screenshot 2023-06-19 at 7.png

  2. Run pod install to upgrade the components for the specified baseline.

Upgrade the baseline

  1. In the Podfile, change the baseline number for mPaaS_baseline to upgrade the entire baseline. For example, you can change 10.1.68 to 10.2.3. Standard and custom baselines are supported.

    image.png

  2. Run pod install to complete the baseline upgrade.

Switching the mPaaS iOS podspec address

Background

The mPaaS podspec repository at code.aliyun.com has been discontinued. It stopped receiving updates on June 1, 2023, and the service was terminated on June 30, 2023.

If you continue to use the old repository, you will experience the following issues:

  1. When you update the SDK using the mPaaS pod plugin, you cannot pull the latest baseline versions.

  2. After June 30, 2023, you cannot pull any baseline versions using the mPaaS pod plugin.

All mPaaS versions are now supported on gitee.com.

Solutions

Upgrade the mPaaS pod plugin

Run the following command to update to the latest mPaaS pod plugin:

sh <(curl -s http://mpaas-ios.oss-cn-hangzhou.aliyuncs.com/cocoapods/installmPaaSCocoaPodsPlugin.sh)

After the command finishes, run pod plugins installed in the terminal and check the version of cocoapods-mPaaS. The upgrade is successful if the version is 0.9.6 or later.

image.png

Modify the source configuration in the podfile

In your Podfile, replace the original source "https://code.aliyun.com/mpaas-public/podspecs.git" with the following:

source "https://gitee.com/mpaas/podspecs.git".

API changes

This modification only involves changes to the plugin. The usage of plugin commands remains unchanged.

Test and verify

After you complete the upgrade and configuration changes, run the mPaaS pod plugin pull commands to test whether you can pull the latest baseline version and SDK.

Parameter list

You can configure parameters to change some of the default behaviors of the plugin.

Procedure:

Add parameters after plugin "cocoapods-mPaaS" in your Podfile. The following shows an example:

image.png

Parameter

Feature

Applicable version

:guard_image_version => 6

Generating a V6 Bodyguard image

≥ V0.9.6

:guard_image_version => 5

Generate a V5 security image

≥ V0.9.6

:only_frameworks => true

In some scenarios, such as a standalone framework project, you do not need to automatically add the mPaaS template directory files.

≥ V0.9.5.0.0.2

:check_repo => false

In some scenarios, such as when using an internal network agent, the default repo is not automatically checked and added.

≥ V0.9.5.0.0.2

Note

For baseline version 10.2.3, you do not need to set :guard_image_version because a V6 image is generated by default.

Command list

After you install the cocoapods-mPaaS plugin, you can use the command line interface (CLI) to assist with your development.

Command

Feature

pod mpaas init

Adds plugin, source, and mPaaS_baseline to the Podfile.

pod mpaas update <VERSION>

Updates the baseline and the podspec repository. The <VERSION> parameter is the specific baseline number, such as 10.2.3.

pod mpaas update --all

In the official plugin, this command upgrades the plugin by rerunning the installation script. In the beta plugin, this command also updates the local baseline.

pod mpaas info

Displays complete information about baselines and their corresponding components.

pod mpaas info <NAME> <VERSION> (where <VERSION> is optional)

Filters information for a specific module name.

pod mpaas info --only-mPaaS

Displays partial default baseline information for easy one-click pasting into the Podfile.

pod mpaas open

Opens the .xcworkspace file directly from the command line.

pod mpaas version

Displays the full baseline used by the current project.

pod mpaas version --plugin

Displays the version number of the current Cocoapods-mPaaS plugin.