Professional Documents
Culture Documents
For example, you can use this service to send a promotion message of a
course when a user views learning information, improving the course
purchase rate.
Use Case of In-App Messaging Kit
With the help of HUAWEI Analytics, the In-App Messaging SDK is able to report message
display and tap events to AppGallery Connect. You can view the statistics on message displays,
taps, and conversion data in AppGallery Connect for operations decision-making.
02 HMS In-App message Kit
Required Settings
Create a new app or project in the Huawei app gallery connect.
Provide the SHA Key and App Package name of the android project in App Information Section.
Download the agconnect-services.json from App Information Section. Add the json file in the app
folder of the android project.
Add maven url inside the repositories of buildscript and allprojects respectively (project build.gradle
file)
Add class path inside the dependency section of project build.gradle file.
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
Add plugin in the app build.gradle file
implementation 'com.huawei.agconnect:agconnect-appmessaging:1.4.2.301'
implementation 'com.huawei.hms:hianalytics:5.1.0.301'
a. INTERNET
b. ACCESS_NETWORK_STATE
c. ACCESS_WIFI_STATE
In order to test in-app message, data must be obtained from the AppGallery Connect
server by force. The setForceFetch API can be used only for message testing.
appMessaging.setForceFetch();
04 Creating An In-App
Message
Sign in to AppGallery Connect and click My projects.
Find and click your project.
After selecting your project, you will select App Messaging from the menu. It will look like
this:
Select New button to create new In-App Message to send to the device.
Select the message type from the Type drop-down list box. Currently, the following options
are supported:
Pop-up
Image
Banner.
After providing the details in set style and content section, you will move on to the Image
section. We will provide two image here for portrait and landscape mode of the app.
Remember for portrait the image aspect ratio should be 3:2 (300x200) and
for landscape the image aspect ratio should be either 1:1 (100x100) or 3:2
(300x200)
We can also provide a button in the Pop-up message. The button contains an action. This
Action contains two option. We can provide user with Disable Message action or redirect user
to particular URL.
Other parameters required for each message type are described as follows.
Here you can click New condition to add a condition for matching target users. Conditio
n types include app version, OS version, language, country/region, audience,
user attributes, last interaction, and initial startup.
The next section is the Set Sending Time section.
We can schedule a date and time to send message.
We can also provide an End date and time to stop sending message.
We can also display message on an events by using trigger event functionality. For example, you can
display a discount of an item in a shopping app. A trigger event is required for each in-app message.
Also you can flexibly set the frequency for displaying the message.
The last section is the Set Conversion Event section. This is section is optional
Click Save in the upper right corner to complete message creation. Also you can click
Preview to preview the display effect of your message on a mobile phone or tablet.
Click Add test user and enter the AAID of the test device in the text box. Also run the app in
order to find AAID of the test device in the logcat of the Android Studio.
Publish the message by selecting publish option in the operation column.
The final result
Check whether the message meets the following display conditions: start time, end time, trigger event
ID, and frequency limit.
Check whether the device is a test device. A test device synchronizes in-app message data from the
AppGallery Connect server every time a trigger event takes place. Non-test devices perform the
synchronization only once a day and read message data from the local cache for display upon
subsequent trigger events.
If the device is a non-test device, check whether the in-app message is published after app launch. If so,
the in-app message will be displayed on the next day. In this case, the situation that you encountered is
not a problem.
https://forums.developer.huawei.com/forumPortal/en/topic/0201321056133360263?fid=0101187876626530
001
Thank You