How can we trigger app messaging with custom events ?

Serkan Mutlu
Huawei Developers
Published in
4 min readFeb 12, 2021

Hello everyone, In this article, we will be exploring how to be triggered in-app messaging with custom events. Article consists of three sections that include Analytics kit custom event, in-App message and example that shows us how to use these features with together.

1.HMS Analytics Kit Custom Events

Analytics Kit allows you to customize events and extend event parameters, or add personalized parameters for predefined events.

2. Huawei AGC App Messaging

App Messaging can be used to send messages to target users using your app to encourage them to use key app functions or send attractive promotion activities to enhance user loyalty.

Developers can customize how their messages look and the way they will be sent, in addition to default message styles. App messaging service can be used with Android and IOS devices. Before use app messaging service, you can check its restrictions with following page : Link

Note : In-App Message is free service.

Key functions of AGC App Messaging

  • Collecting message statistics : Developers can monitor in-app message statistics such as in-app message displays, message taps and occurrences of the conversion event.
  • Customizing the message style : App messaging provides three message styles and they can be customized by developers.
  • Sending targeted messages : In-app messages can be sent based on user behavior contexts to promote user subscription and payment conversion.
    If you want to check use cases, you can visit following page : Link

3.How to use these with together

In-app Messages can be triggered by preset and HUAWEI Analytics events. In this section We will focus on triggered by Analytics events.

Custom event should be defined to trigger app message. This can be done with two ways. Firstly you can create it using bundle in your app. Other way developers create it using AGC. Both way are easy and you can find them under this line.

Creating custom event in AGC

  1. First of all we need to create three custom events for Pop-up, image and banner messages. Following image shows us relevant path to create custom event.

Note : Before start creating custom events, Analytics kit should be enabled in AG console.

After click create button, Custom event should be selected to use in App message triggering.

As you see , If you need to collect information that comes from users, you can declare parameter/parameters and analyze them using analytics kit. Detail information about custom events and data monitoring, you can benefit from following article : Link

Three custom events were declared to use in example.

2. Now we need to create App message style and bind them with custom events.

  • Message Definitions

Note : Before start to design message, AGC App messaging should be enabled in AG console.

All message has different UX features to serve users. For example Popup message’s UX consist of four parts title, image, body message and redirect button. Title , redirect button and image are mandatory. In addition image’s aspect ratio should be 3:2. Developers can change text, body, button and body background colors. Pop-up message can include at most two button. It can be used to show promotions after collect information about customers.

Pop-up Message

After finish design process, We need to bind message with relevant custom event. If you need to determine time period, you can set schedule to trigger message. A message can be triggered with many event as you see.

This section is same for all message type, Developers just need to determine trigger and other settings.

Message Settings

3.Analytics and app-Messaging dependencies should be added in app level build file.

4.You can check which method can be used to trigger app-messaging.

Previews

Pop-up Message

Image Message

Banner Message

References

AGC App Messaging Page : Link

HMS Analytics Kit — Custom event Page : Link

Custom Event Example : Link

--

--