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
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-mpaasNode.js
Execute the following command to add SDK-related dependencies.
npm i @alicloud/mpaas20190821PHP
Execute the following command to add SDK-related dependencies.
composer require alibabacloud/sdkEnvironment 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>NoteReplace
access_key_idwith your AccessKey ID andaccess_key_secretwith your AccessKey Secret.For Windows systems:
Create new environment variables named MPAAS_AK_ENV and MPAAS_SK_ENV, and set them with your AccessKey ID and AccessKey Secret, respectively.
Restart the Windows system.