This section describes how to generate configurations based on the native plug-in extension mechanism of CocoaPods to quickly access mPaaS.
The CocoaPods mPaaS plug-in has been installed. If the plug-in has not been installed, run the following command to install it.
sh <(curl -s http://mpaas-ios.oss-cn-hangzhou.aliyuncs.com/cocoapods/installmPaaSCocoaPodsPlugin.sh)
An application has been created in the console, and the
.configconfiguration file has been downloaded. For more information, see Create an application in the console.
.configconfiguration file to the root directory (at the same level with
Podfile) of the project.Note
Please ensure the
.configfile’s filename is ending with iOS. If it is ending with ios, it needs to be updated to iOS manually.
pod mpaas initcommand to automatically process the
Podfilefile and add
mPaaS_baselineconfigurations. The code for automatic configuration is as follows:
plugin "cocoapods-mPaaS" source "https://code.aliyun.com/mpaas-public/podspecs.git" mPaaS_baseline 'x.x.x'
mPaaS_baselineto specify the mPaaS baseline.
For example, in
10.1.32is the baseline version. For version differences, see Release Note.
mPaaS_podto add mPaaS component dependencies.
For example, in
mPaaS_Nebulais a component name. The following table shows more component names.
Mobile analysis: behavior log, automation log, Crash log, and performance log analysis.
Diagnosis: Client diagnosis and analysis.
Mobile gateway: provides download, upload, RPC call and other functions.
Mobile synchronization: long connection service.
Switch configuration: pull the corresponding value from the server based on the key to dynamically control the client logic.
Hotpatch: used to fix online bugs without releasing a new version.
Upgrade release: provides convenient service to proactively detect and upgrade, which can be used for daily phased release and online new version update reminder.
Sharing: supports sharing text and pictures to well-known channels such as Weibo, DingTalk, and Alipay friends.
HTML5 container and offline package: Nebula container, which supports interaction between the front end and the native.
Device ID: easily and quickly obtained for the application to find a specific device safely and effectively.
Unified storage: provides secure, fast, encryptable KV storage that supports multiple data types. The database DAO supports multiple solutions for persistent data storage.
Code scan: quickly identifies QR codes and barcodes.
Mobile positioning: positioning solution for mobile clients.
Universal UI: universal UI component library that provides various UI components.
Badge: badge reminder component of the client, which supports reminder styles such as badge, number, and New. It can automatically manage the badge relationship of a tree structure.
Quick Pay function of Alipay: quick payment platform of Alipay.
Multimedia component: supports image download, upload, cache and other functions.
Mobile framework: client application framework, sub-app management, multi-tab application management, third-party redirection management, viewController redirection, and exception handling and reporting.
Applets: integrates lease capabilities.
Basic test: basic test module.
Intelligent delivery: configure various intelligent advertisements and presentations to the clients with dynamic launches.
Mini program: publish the mini program
Voice call and video call: Voice call and video call components. This feature supports two-party video calls, group video calls and online conferences.
See the following example of complete Podfile:
pod mpaas update x.x.xin the command line,
x.x.xis the version number of configured baseline, such as
pod installto complete access. You can also add
--verboseto view log details.Note
If you are prompted when you execute
pod installthat you cannot find the library imported from GitHub’s official website, specify the source address for the official GitHub Source at the beginning of podfile:
If you find the third-party library conflicts after accessing it, you can remove the specific third-party library. For the specific operation, see iOS conflict processing.
When a new version of mPaaS is published, you can select the upgrading components, or the general upgrading baseline (namely SDK version).
When you execute
pod mpaas update x.x.xin the command line,
x.x.xis the baseline version number currently in use, such as
pod installto complete upgrading for the corresponding components under this baseline.
Upgrade the baseline
podfile, modify the corresponding baseline number of
mPaaS_baselineto complete upgrading for the general baseline. For example, you can modify the baseline number from
10.1.60. The baseline number supports the standard or custom baseline.
pod installto complete baseline upgrading.
You can change some default behaviors of the plug-in by configuring parameters.
plugin "cocoapods-mPaaS". See the following examples:
In some scenarios (such as the independent framework project), you do not need to add directory files with mPaaS template.
After installing the cocoapods-mPaaS plug-in, you can use command line tools to assist your development.
Upgrade the baseline. The parameter
In the official version of the plug-in, this command will upgrade the plug-in, and run the installation script again.
In the beta version of the plug-in, this command will implement features of the official version, and upgrade the local baseline.
Show the complete information of the baseline and the corresponding component.
, in which
Filter the information about a module name. For example,
Show some default baseline information, which is easy to be pasted to Podfile.
Directly open the
Show the complete baseline used in the current project.
Show the version number of the current cocoapods-mPaaS plug-in.