目录

Quick App

Introduction to Quick Apps

Huawei quick apps are free of installation. Compared with traditional Android apps, quick apps have the following advantages:

Push Kit allows for message sending to Huawei quick apps.

Preparations

Before you start developing a quick app, configure your app information in AppGallery Connect. The procedure is as follows:

  1. Register as a developer
  2. Create a quick app
  3. Generate a certificate fingerprint
  4. Enabling Push Kit

For details, please refer to Creating a Quick App.

Development Guide

[h2]Token Obtaining

For details about how to obtain a token, please refer to Integrating Push Kit.

[h2]Message Sending

You can customize the message payload (by setting the message type to the data message) to send messages to quick apps. The message content will be parsed by Huawei Quick App Engine. The following second table lists the parameters in a message body to be sent to a quick app.

Parameter

Type

Mandatory (M)/Optional (O)

Description

pushtype

Integer

M

Message type. The options are as follows:

  • 0: notification message
  • 1: data message

pushbody

pushbody Object

M

Message body. For details about the structure, please refer to pushbody.

pushbody

Parameter

Type

Mandatory (M)/Optional (O)

Description

title

String

O

Notification message title.

description

String

O

Notification message content.

page

String

O

Path of the quick app page that is displayed when a user taps a notification message.

params

Object

O

Data contained in the message body when a user taps a notification message. Example: {\"key1\":\"test1\",\"key2\":\"test2\"}

NOTE:

When pushtype is set to 0, a message that does not contain the params parameter can be successfully sent but will not be displayed.

ringtone

ringtone Object

O

Vibration and breathing light for the notification message. For details, please refer to ringtone.

messageId

String

O

Data message ID.

data

String

O

Data message content.

ringtone

Parameter

Type

Mandatory (M)/Optional (O)

Description

vibration

String

O

Indicates whether to vibrate when receiving a message. The value true indicates yes.

breathLight

String

O

Indicates whether to display the breathing light when receiving a message. The value true indicates yes.

You can use either of the following methods to send messages:

A quick game can receive push messages when the following conditions are met.

Message Type

Prerequisite

Notification message

A quick app has been used before, and either of the following conditions is met:

  • Quick App Center earlier than 3.2.1: The quick app has been added to the home screen or My quick apps, or is running.
  • Quick App Center 3.2.1 or earlier: The quick app has been added to the home screen or favorites.
  • To debug your app on Huawei Quick App Loader, ensure that the loader is running.
  • If you have installed Phone Manager on your phone for debugging, enable auto-launch for your quick app in Phone Manager.
  • You can refer to the sample code to develop your quick app for adaptation.

Checklist

After integrating Push Kit into your app, check your app against the Pre-release Checklist and make sure your app meets all requirements before submitting it for release.