目录

Getting Started

Development Environment

The following table lists the supported browser types and versions.

Device Type

Browser Type

Version

PC

Chrome

78 or later

Firefox

56 or later

Edge

44.18362.1.0 or later

Development Process

Follow the steps in the following process when you develop a web app.

Step

Description

Create an app

Register as a Huawei developer. Create an app and configure app information in AppGallery Connect.

Enable the WebPush agent

Enable the WebPush agent in AppGallery Connect.

Generate a key pair for the WebPush agent

In Web push configuration, click Generate key pair. Alternatively, use the CLI to generate a key pair and import it in Web push configuration.

Configure the project

Copy the code snippets in Web push configuration to your project.

Receive a message in the foreground

Use the callback function to receive a message when the browser is running in the foreground.

Obtain a token

Obtain a token to access Push Kit.

Send a message

Use the Push Kit server API to send a message to a web app.