Code samples

Updated at:

This topic lists all mPaaS code samples.

Code samples are updated periodically as features evolve. We recommend that you download the latest version when you integrate a component. For update descriptions and usage instructions, see the corresponding README.md file.

For the differences between SDK versions, see the Release Notes.

V10.2.3

Android

The code samples for all Android components are bundled into a single ZIP package.

Native AAR-based integration: mpaas_android_app.zip.

iOS

The code samples for all iOS components are bundled into a single ZIP package.

Cocoapods-based integration: iOS_for_mPaaS.zip.

HarmonyOS NEXT

Important
  • Windows users must use the aggregated demo.

  • macOS users can choose either the aggregated demo or the individual demos.

  • The aggregated demo and individual demos provide the same features.

Aggregated demo

The code samples for all HarmonyOS NEXT components are bundled into a single ZIP package.

HarmonymPaaSDemo.zip

Individual demos

Component

ZIP package

Mobile Message Push

PushDemo.zip

Mobile Sync

mpaas_sync_demo.zip

Mobile Analysis Service (MAS)

mPaaSMasDemo.zip

App Upgrade

mPaas_Harmony_Upgrade.zip

Mobile Config

MpaasDemoConfig.zip

H5 container

mPaasDemoHarmonyOS.zip

Mini Program

MPTinyAppDemo.zip

Mobile Gateway Service (MGS)

mpaas_rpc_demo.zip

Unique Device ID

mpaas_udid_demo.zip

Scan

mPaaS_scan_demo.zip

Mobile Data Storage

mpaas_datacenter_demo.zip

Note

Some network components have limited functionality. To access the full feature set, submit a ticket.

V10.1.68 and 10.1.60 (No longer maintained)

Android

Component

AAR

mPaaS framework

mPaaS framework

Mobile Gateway Service (MGS)

Mobile Gateway Service (MGS)

Mobile Message Push

Mobile Message Push

Mobile Sync

Mobile Sync

Mobile Analysis Service (MAS)

Mobile Analysis Service (MAS)

App Upgrade

App Upgrade

Mobile Config

Mobile Config

Hotfix

Hotfix

Targeted Delivery

Targeted Delivery

H5 Container & Offline Package

H5 Container & Offline Package

Mini Program

Mini Program

Native UI Component (AntUI)

Native UI Component (AntUI)

Social Share

Social Share

Scan

Scan

Mobile Data Storage

Mobile Data Storage

Location

Location

Audio/Video Calling

Audio/Video Calling

iOS

Component

Extension integration

Cocoapods integration

mPaaS framework

mPaaS framework (Cocoapods and Extension)

Mobile Gateway Service (MGS)

Mobile Gateway Service (MGS) (Cocoapods and Extension)

Mobile Message Push

Mobile Message Push (Cocoapods and Extension)

Mobile Sync

Mobile Sync (Cocoapods and Extension)

Mobile Analysis Service (MAS)

Mobile Analysis Service (MAS) (Cocoapods and Extension)

App Upgrade

App Upgrade (Cocoapods and Extension)

Mobile Config

Mobile Config (Cocoapods and Extension)

Mobile Diagnostics

Mobile Diagnostics (Cocoapods and Extension)

Targeted Delivery

Targeted Delivery (Cocoapods and Extension)

H5 container

H5 container (Cocoapods and Extension)

Mini Program

Mini Program (Cocoapods and Extension)

Native UI Component (AntUI)

Native UI Component (AntUI) (Cocoapods and Extension)

Social Share

Social Share (Cocoapods and Extension)

Scan

Scan (Cocoapods and Extension)

Mobile Data Storage

Mobile Data Storage (Cocoapods and Extension)

Location

Location (Cocoapods and Extension)

Audio/Video Calling

Audio/Video Calling (Cocoapods and Extension)

Front-end framework

Note

mPaaS has discontinued Kylin in favor of the more advanced and stable Mini Program component. Compared to Kylin, the Mini Program component is easier to use, more stable, and more adaptable across various scenarios. We recommend new users to integrate the Mini Program component. If you have already integrated the Kylin framework, we recommend migrating to the Mini Program component. For more information, see Mini Program.

V10.1.32 (No longer maintained)

Android

The code samples for all Android components are bundled into a single ZIP package.

Android supports two integration methods: mPaaS framework-based and native framework-based. Select the code sample that matches your integration method. For more information, see Introduction to access methods.

iOS

iOS supports integration using both CocoaPods and the mPaaS plug-in. For more information, see Introduction to access methods.

The code samples are available at the following links:

Note

The Collection ZIP package contains the code samples for all components in the following table.

Component

CocoaPods

mPaaS plug-in

Extension plug-in

Collection (including all components)

ios-portal-pod-demo-10.1.32-201904020020.zip

N/A

N/A

Mobile Message Push

ios-push-pod-demo-10.1.32-201904021854.zip

ios-push-plugin-demo-10.1.32-201904031034.zip

N/A

Mobile Sync

ios-sync-pod-demo-10.1.32-201904011523.zip

ios-sync-plugin-demo-10.1.32-201904012111.zip

N/A

Mobile Analysis Service (MAS)

ios-mas-pod-demo-10.1.32-201904021854.zip

ios-mas-plugin-demo-10.1.32-201904031033.zip

N/A

App Upgrade

ios-upgrade-pod-demo-10.1.32-201904011823.zip

ios-upgrade-plugin-demo-10.1.32-201904012120.zip

N/A

Mobile Config

ios-config-pod-demo-10.1.32-201904011823.zip

ios-config-plugin-demo-10.1.32-201904012120.zip

N/A

H5 container

ios-h5-pod-demo-10.1.32-201904011823.zip

ios-h5-plugin-demo-10.1.32-201904020037.zip

N/A

Mini Program

ios-tinyapp-pod-demo-10.1.32-201904011823.zip

ios-tinyapp-plugin-demo-10.1.32-201904021353.zip

N/A

Mobile Gateway Service (MGS)

ios-rpc-pod-demo-10.1.32-201904011523.zip

ios-rpc-plugin-demo-10.1.32-201904012111.zip

N/A

Social Share

ios-share-pod-demo-10.1.32-201904021142.zip

ios-share-plugin-demo-10.1.32-201904021142.zip

Social Share (Extension)

Unique Device ID

ios-utdid-pod-demo-10.1.32-201904011523.zip

ios-utdid-plugin-demo-10.1.32-201904012111.zip

N/A

Scan

ios-scancode-pod-demo-10.1.32-201904021142.zip

ios-scancode-plugin-demo-10.1.32-201904021142.zip

Scan (Extension)

Mobile Data Storage

ios-datacenter-pod-demo-10.1.32-201904021845.zip

ios-datacenter-plugin-demo-10.1.32-201904031043.zip

N/A

Location

ios-lbs-pod-demo-10.1.32-201904021142.zip

ios-lbs-plugin-demo-10.1.32-201904021142.zip

Location (Extension)

mPaaS framework

ios-framework-pod-demo-10.1.32-201904011823.zip

ios-framework-plugin-demo-10.1.32-201904012120.zip

N/A

Native UI Component (AntUI)

ios-antui-pod-demo-10.1.32-201904011823.zip

ios-antui-plugin-demo-10.1.32-201904012120.zip

N/A

Mobile Diagnostics

ios-diagnose-pod-demo-10.1.32-201904011523.zip

ios-diagnose-plugin-demo-10.1.32-201904012111.zip

N/A

Targeted Delivery

Targeted Delivery (Cocoapods)

ios-cdp-plugin-demo-10.1.32-201908081626.zip

Targeted Delivery (Extension)