All Products
Search
Document Center

Mobile Platform as a Service:SDK preparation

Last Updated:Jun 05, 2025

MPS supports four programming languages: Java, Python, Node.js, and PHP. Before you call the preceding APIs for message push, you should make different preparations for different programming languages. The following examples describe the preparations needed before implementing the SDK for different programming languages.

Java

Note

For users outside the financial zone, the latest message push SDK version is 3.0.23. For users within the financial zone, it is 2.1.11.

<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-mpaas</artifactId>
  <version>3.0.23</version>
</dependency>

<dependency>
<groupId>com.aliyun</groupId>
  <artifactId>aliyun-java-sdk-core</artifactId>
  <optional>true</optional>
  <version>[4.3.2,5.0.0)</version>
</dependency>

Python

Execute the following commands to add SDK-related dependencies.

## Alibaba Cloud SDK
pip install aliyun-python-sdk-core
## mpaas SDK 
pip install aliyun-python-sdk-mpaas

Node.js

Execute the following command to add SDK-related dependencies.

npm i @alicloud/mpaas20190821

PHP

Execute the following command to add SDK-related dependencies.

composer require alibabacloud/sdk

Environment variable configuration

Configure the environment variables MPAAS_AK_ENV and MPAAS_SK_ENV.

  • For Linux and macOS systems, execute the following commands:

    export MPAAS_AK_ENV=<access_key_id>
    export MPAAS_SK_ENV=<access_key_secret>
    Note

    Replace access_key_id with your AccessKey ID and access_key_secret with your AccessKey Secret.

  • For Windows systems:

    1. Create new environment variables named MPAAS_AK_ENV and MPAAS_SK_ENV, and set them with your AccessKey ID and AccessKey Secret, respectively.

    2. Restart the Windows system.