Message Push provides software development kits (SDKs) for Java, Python, Node.js, and PHP. Before you can push messages, you must set up the SDK for your programming language.
The following sections describe how to set up the SDK for each language.
Java
The latest version of the Message Push V2.0 SDK is 5.0.2 for users in non-finance regions. For users in finance regions, the latest version is 2.1.11.
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>mpaas20201028</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>tea-openapi</artifactId>
<version>0.3.6</version>
</dependency>Python
Run the following command to add the SDK dependencies.
## Alibaba Cloud SDK
pip install aliyun-python-sdk-core
## mPaaS SDK
pip install aliyun-python-sdk-mpaasNode.js
Run the following command to add the SDK dependencies.
npm i @alicloud/mpaas20190821PHP
Run the following command to add the SDK dependencies.
composer require alibabacloud/sdkEnvironment variable configuration
Configure the MPAAS_AK_ENV and MPAAS_SK_ENV environment variables.
On Linux and macOS, run the following command:
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.Configuring the Windows system
Create the MPAAS_AK_ENV and MPAAS_SK_ENV environment variables. Set their values to your AccessKey ID and AccessKey secret.
Restart Windows.