More information like this, you can visit HUAWEI Developer Forum
Multiple entries to a quick app released on AppGallery help improve the quick app's impressions and bring more traffic to developers. Standard deep links are provided to implement this function.
Deep links can be applied in the following scenarios:
Sharing on social platforms
The deep link of a quick app shared through social platforms can redirect a user to the quick app after the user taps the deep link.
Advertising
The deep link of a quick app embedded in an ad can redirect a user to the quick app after the user taps the deep link.
Operational events
The deep link of a quick app embedded in the promotion page of an operational event can make it easier for users to participate in the event.
The following formats are supported:
(Recommended) hap://app/<package>/[path][?key=value]
https://hapjs.org/app/<package>/[path][?key=value]
(Applicable to Huawei phones only) hwfastapp://<package>/[path][?key=value]
package: App package name, which is mandatory.
path: Path of the page in the app. This parameter is optional. If this parameter is not set, the home page is used by default.
key-value: Parameter to be passed to the page. This parameter is optional. Multiple key-value pairs are allowed. The passed parameter values may be obtained by other apps. Therefore, you are advised not to transfer data with high security sensitivity.
The following takes a demo quick app with a package name of com.huawei.quickapp as an example to describe how to use deep links.
The following information is obtained from the manifest.json file of the demo quick app.
package: com.huawei.quickapp
name: demo
pages: include the Hello page and the Detail page, with Hello being the home page.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The sample code for calling the deep link to open the demo quick app is as follows:
Code:
import router from '@system.router'
router.push({
uri: 'hap://app/com.huawei.quickapp'
})
The sample code for opening the demo quick app after a user taps a link on a web page is as follows:
Code:
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<a href="hap://app/com.huawei.quickapp" > redirect to a demo quick app</a>
</body>
</html>
In the preceding example, the page to which a user is redirected is not configured. Therefore, the Hello page of the demo quick app is displayed by default. To display the Detail page, modify the code as follows:
Code:
import router from '@system.router'
router.push({
uri: 'hap://app/com.huawei.quickapp/Detail'
})
If parameters need to be transferred to the Detail page, add the parameters to the code in the key-value format. Multiple parameters are separated by ampersands (&). If the source and name parameters are transferred to the Detail page, the code is modified as follows:
Code:
import router from '@system.router'
router.push({
uri: 'hap://app/com.huawei.quickapp/Detail?source=net&name=aa'
})
The code for obtaining the values of the parameters that have been transferred to the Detail page is as follows:
Code:
onShow: function () {
var nameValue=this.name;
var sourceValue=this.source;
}
You can test the redirection of the deep link after the development is complete.
Notice: Before the test, ensure that usage records of the quick app to be redirected to exist in Quick App Loader.
[Test Method 1] Run the android adb command. (The ADB environment must be configured on your computer.)
adb shell am start -a android.intent.action.VIEW -d hap://app/com.huawei.quickapp/Detail
Notice: This method does not apply to scenarios where multiple parameters are transferred.
[Test Method 2] Add the deep link to be tested to a local web page.
Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
window.location.href="hap://app/com.huawei.quickapp/Detail?source=net&name=aa";
</script>
</body>
</html>
For more details, you can go to:
Official website
Development Documentation page, to find the documents you need
Reddit to join our developer discussion
GitHub to download demos and sample codes
Stack Overflow to solve any integration problems
Related
This is originally from HUAWEI Developer Froum
Forum link: https://forums.developer.huawei.com/forumPortal/en/home
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Introduction
Remote config is a feature that allows us to alter both the look and feel of our application without the need to publish any updates to the App Gallery. This works by allowing us to define in-app parameters that can be overridden from within the Huawei App Gallery Connect — these parameters can then be activated for either all or a defined selection of users.
This powerful feature gives us a range of new abilities when it comes to immediate updates, temporary changes or testing new features amongst users. Let’s take a dive and learn the what, why and how of Remote Config so we can learn how to use it to benefit both ourselves and our users
Use Cases
1. Releasing new functions by user percentage.
2. Display country/region-specific promotion content.
3. Personalized content recommendation based on Huawei Analytics.
4. Holiday theme adaptation.
Development Process
· Create sample application in android and configure into AGC.
· Enable Remote Configuration API.
· Download agconnect-service.json and add into app directory.
· Add remote config dependencies in the build.gradle file in app directory.
Code:
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.3.1.300'
· Open AGC select Demo project Growing->Remote Config Now enable Remote Config service
After enabling service, you will get option
· Parameter Management.
· Condition Management.
Parameter Management:
Within Remote Config we define key-value pairs which are known as parameters. These parameters are then used to define the configuration values that are to be used within our app.
· Key — The key is a String used to define the identify for the parameter
· value — The value can be of any other data type and is used to represent the value of our defined parameter.
· After saving parameter management details we can check ,you can add, modify, delete in existing parameters.
Condition Management
Conditions are a collection of rules that we can use to target specific app instances —for example based on gender we can update new changes.
The conditional value itself is also represented as a key-value pair, it’s made up of:
· condition — The condition to be satisfied for the value to be used
§ App version
§ OS version
§ Language
§ Country/Region
§ Audience, etc..
· value — The value to be used if the condition is satisfied
Let’s see code Implementation
· Create Instance for AGConnectConfig
Code:
AGConnectConfig config = AGConnectConfig.getInstance();
· Create config.xml file ,you can set default parameter values before connecting to remote config service.so that your app can run perfectly.
Code:
<?xml version="1.0" encoding="utf-8"?>
<remoteconfig>
<value key="version">1.0</value>
</remoteconfig>
· Call Api to pass default values this will effect immediately.
Code:
config.applyDefault(R.xml.remote_config);
· Fetching parameter values from Remote Configuration
Code:
config.fetch(fetchInterval).addOnSuccessListener(new OnSuccessListener<ConfigValues>() {
@Override
public void onSuccess(ConfigValues configValues) {
config.apply(configValues);
config.getMergedAll();
long remoteVersionCode = config.getValueAsLong("version");
if (currentVersionCode > remoteVersionCode) {
ShowUpdateAlert();
}
Toast.makeText(getBaseContext(), "RemoteVersionCode: "+String.valueOf(remoteVersionCode), Toast.LENGTH_LONG).show();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(Exception e) {
Toast.makeText(getBaseContext(), "Fetch Fail", Toast.LENGTH_LONG).show();
}
});
This is not the end. For full content, you can visit HUAWEI Developer Forum.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi Everyone!
Command-line interfaces (CLIs) built in Node.js allow you to automate repetitive tasks while leveraging the vast Node.js ecosystem. And thanks to package managers like npm and yarn, these can be easily distributed and consumed across multiple platforms.
In this post I will introduce Quick Apps and a Command-line interface that i developed and published to generate Quick Apps from H5 in a different way.
What is Quick Apps?
Quick apps are a new type of installation-free app and are supported by more than 12 major Chinese mobile phone manufacturers.
Strengths of Quick Apps
Low Cost: A quick app requires only 20% of the code of an Android app and can be developed within as little as 3 days.
Native Experience: Quick apps are installation-free and can update automatically. They can offer an excellent native experience.
High Retention: Installation-free quick apps can be added to the home screen and directly used with a single touch, which helps to attract and retain more users.
Easy Access: After being seamlessly integrated into HUAWEI Ability Gallery, quick apps can be easily accessed through HUAWEI Assistant, Global Search, and more.
How to develop your quick app?
Sign in to AppGallery Connect and create a quick app.
Apply for services that you are ready to integrate into the quick app.
Download and install Huawei Quick App IDE.
Develop your quick app according to relevant requirements.
Submit the RPK and wait for review.
Converting an H5 App into a Quick App
Quick apps are different from HTML5 apps. A quick app has its own development standards and runs based on the Quick App Center. However, quick apps support HTML5 web page loading through the web component. In this way, HTML5 apps can be converted into quick apps quickly. After a quick app generation and release in HUAWEI AppGallery, users can directly open the app and have the same experience as using the original HTML5 app.
Conversion can be handled in Huawei Quick App IDE or online.
To learn more about online conversion, check out this article.
To learn more about conversion by IDE, check out this article.
H5 to QuickApp CLI
Prerequisites: npx which comes with npm 5.2+ and higher.
To create a single QuickApp:
Code:
npm install -g @onurkenis/create-quick-app # install globally once
create-quick-app # run from anywhere
npx @onurkenis/create-quick-app # run via npx without installing
Batch application creation from JSON:
Code:
npm install -g @onurkenis/create-quick-app # install globally once
create-quick-app --fromJson=path_of_json # run from anywhere
npx @onurkenis/create-quick-app --fromJson=path_of_json # run via npx without installing
JSON format for Batch Creation:
Code:
{
"projects": [
{
"appName": "TestApp1",
"packageName": "com.onurkenis.one",
"url": "https://github.com/onurkenis/create-quick-app",
"icon": "C:/Pictures/optional_icon.jpg"
},
{
"appName": "TestApp2",
"packageName": "com.onurkenis.two",
"url": "https://github.com/onurkenis/create-quick-app"
},
{
"appName": "TestApp3",
"packageName": "com.onurkenis.three",
"url": "https://github.com/onurkenis/create-quick-app"
}
]
}
Options:
All options can be empty when running the create-quick-app. Missing fields will be asked respectively. Batch creation is only available in-line.
Code:
const args = {
'--appName': String, // name of your application
'--packageName': String, // package name of your application
'--url': String, // url to render in app
'--icon': String, // path of app icon. default icon will be used if this field is empty
'--fromJson': String, // Path of JSON file for batch creation
};
Code:
npx @onurkenis/create-quick-app
--appName="My App"
--packageName=com.onurkenis.myApp
--url=https://github.com/onurkenis/create-quick-app
--icon=./icon.png
RPK Generation:
To get rpk file, do followings and check
Code:
PROJECT_PATH/dist
folder.
Code:
cd PROJECT_PATH
npm install
npm run release
References
You can check out the source code and npm package from following links:
https://github.com/onurkenis/create-quick-app
https://www.npmjs.com/package/@onurkenis/create-quick-app
Quick Apps Official Page:
https://developer.huawei.com/consumer/en/huawei-quickApp
Scenarios:
https://developer.huawei.com/consumer/en/doc/development/quickApp-Guides/quickapp-scenario
Converting an H5 App into a Quick App:
https://developer.huawei.com/consumer/en/doc/development/quickApp-Guides/quickapp-h5-to-quickapp
Related Links
Thanks to Onur Kenis for this article.
Original post: https://medium.com/huawei-developers/h5-to-quickapp-cli-create-projects-with-one-line-28c94bf5bcae
More information like this, you can visit HUAWEI Developer Forum
Original link: https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201332997357290022&fid=0101187876626530001
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hello everyone. In this article, I would like to talk about Remote Configuration — A/B Testing. What are they and where are they used? I want to start with these.
Remote Configuration
With the service, you can make changes in the behavior and appearance of your application without any updates. This process is managed by determining various parameters on the Console.
Use Cases:
Displaying the Language by Country/Region
Displaying Different Content to Different Users
Adapting the App Theme by Time
Releasing New Functions
Configurations
Go to Growing> Remote Configuration. Click Enable now to enable Remote Configuration.
Add the Remote Configuration dependencies in the build.gradle file in the app directory.
Code:
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.4.0.300'
Development
I have prepared a demo app to explain this service better. I’ll talk about it step by step.
First, I set the parameter using the Parameter Management tab in the Remote Config tab.
Then I determined the condition in the Condition Management tab and defined it in the parameter tab.
After the integration process on AGC is completed, you can start writing code on the application. In the code part, you must first specify the parameter you defined in AGC. You can do this by using the “Map” object or “XML”. I used XML.
Code:
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
/*
- Using a Map object
val mapDefault = mapOf("language" to "other",
"key2" to "val2",
"key3" to "val3",
"key4" to "val4")
- Using an XML resource file
<?xml version="1.0" encoding="utf-8"?>
<remoteconfig>
<value key="language">other</value>
</remoteconfig>
*/
val agConnectConfig = AGConnectConfig.getInstance()
agConnectConfig.applyDefault(R.xml.remote_config)
remoteButton = findViewById(R.id.remote)
remoteButton?.setOnClickListener {
agConnectConfig.fetch(0).addOnSuccessListener {
agConnectConfig.apply(it)
val languageResponse = agConnectConfig.getValueAsString("language")
Toast.makeText(this, languageResponse, Toast.LENGTH_LONG).show()
if (languageResponse == "en"){
showUpdateAlert("Language is English")
}
else if(languageResponse == "other"){
showUpdateAlert("Language is not English")
}
}.addOnFailureListener {
// fail fetching from remote config
it.printStackTrace()
}
}
}
After writing the code, you can test the Remote Configuration by making changes on the device according to the parameter.
A/B Testing
You can use the service to create one or more A/B tests engaging different user groups to compare your variants of app UI design, copywriting, product functions, or marketing activities for performance metrics and find the best one that meets user requirements.
Use Cases:
App UI Design Testing
App Copywriting Testing
App Function Testing
Configurations
Go to Growing > A/B Testing. Click Enable now in the upper right corner.
After the service is enabled, the page shown in the following figure is displayed.
Notifications Experiment:
When you want to send notifications to existing users, you can use the A/B Testing to find out which user is affected by what type of notification.
Remote Configuration Experiment:
You can use A/B Testing to determine specific behaviors for specific user groups in your application or if you want to learn how it affects users before updating your application.
Development
I used the Remote Configuration Experiment. I’ll try to explain the steps here.
Firstly, you need to access Analytics Kit to obtain the target experiment users and experiment data, and generate experiment reports.
Enable Analytics Kit
Add the following code to the build.gradle file in the app directory
Code:
implementation 'com.huawei.hms:hianalytics:4.0.2.300'
Create User Attributes in this way to use the User Attributes condition.
Create a condition on the Remote Configuration tab.
Use Conditions to create your parameter.
Then you will see a four-step screen when you press the Create Remote Configuration Experiment button on the A/B Testing tab.
Set the basic information of the test.
Specify the conditions for finding the target users in this step.
In this step, select your Remote Configuration parameter.
You can select the indicators you want to see as a result of the test. A maximum of 5 options can be selected.
After these steps, you can start writing your code based on the conditions in your application.
Code:
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
/*
- Using a Map object
val mapDefault = mapOf("ABTest" to "c",
"key2" to "val2",
"key3" to "val3",
"key4" to "val4")
- Using an XML resource file
<?xml version="1.0" encoding="utf-8"?>
<remoteconfig>
<value key="ABTest">c</value>
</remoteconfig>
*/
val agConnectConfig = AGConnectConfig.getInstance()
agConnectConfig.applyDefault(R.xml.remote_config)
remoteButton = findViewById(R.id.remote)
remoteButton?.setOnClickListener {
agConnectConfig.fetch(0).addOnSuccessListener {
agConnectConfig.apply(it)
val abTestResponse = agConnectConfig.getValueAsString("ABTest")
if (abTestResponse == "a"){
showUpdateAlert("abTestResponse = A ")
}
else if(abTestResponse == "b"){
showUpdateAlert("abTestResponse = B ")
}
}.addOnFailureListener {
// fail fetching from remote config
it.printStackTrace()
}
}
}
Finally, you need to start your test on the A/B Testing screen. Sufficient data must be collected to obtain the test result.
I’d like to add the screenshots I took while I was doing the test.
Conclusion
By using these two services, you can diversify your application according to your users, thus increasing the interaction. Moreover, without updating the application.
I hope this article was useful.
References
Remote Configuration
A/B Testing
Nice article
Is huawei AB testing better than google firebase AB testing
riteshchanchal said:
Is huawei AB testing better than google firebase AB testing
Click to expand...
Click to collapse
For me, huawei's is better in some aspects. But I actually suggest you have a try by yourself.
Introduction
HMS Video Kit allow us to play video by using a URL or multiple URLs that contain an address of a video. The latest version of this kit allow us to playback videos but in the later version it will support both editing and hosting of videos.
This service helps us to build a superb video experience for our app users.
Use Cases
1) The service can be used in a news app that contains small videos of the reported incident.
2) The service can be used as a video editing app.
3) The service can be used as a promotion video in your application.
4) The service can be used as an educational video related application.
In this article we will be working on one of the use case and that is education video related application. For that we need two major players in any software development and that is server and client.
Demo
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Server Side (Node Server)
Prerequisite
1) We must have latest version of Node installed.
2) We must have latest version of Visual Studio Code installed.
3) Laptop/desktop and Huawei mobile device must share same Wi-Fi connection.
Tool’s required
1) Express js is a Node js web application server framework, designed for building single-page, multi-page, and hybrid web applications. It is the de facto standard server framework for node.js.
We don't have to repeat same code over and over again using Express js. Node.js is a low-level I/O mechanism which has an HTTP module. If you just use an HTTP module, a lot of work like parsing the payload, cookies, storing sessions, selecting the right route pattern based on regular expressions will have to be re-implemented. With Express.js, it is just there for us to use.
Express.js basically helps us manage everything, from routes, to handling requests and views.
2) Request module is by far the most popular (non-standard) Node package for making HTTP requests. Actually, it is really just a wrapper around Node's built in http module, so we can achieve all of the same functionality on your own with http, but request just makes it a whole lot easier.
Code:
const request = require('request');
request(' https://developer.huawei.com/consumer/en/', function(err, res, body) {
console.log(body);
});
The code above submits an HTTP GET request to developer.huawei.com and then prints the returned HTML to the screen. This type of request works for any HTTP endpoint, whether it returns HTML, JSON, an image, or just about anything else.The first argument to request can either be a URL string, or an object of options. Here are some of the more common options you'll encounter in our application:
a) url: The destination URL of the HTTP request
b) method: The HTTP method to be used (GET, POST, DELETE, etc.)
c) headers: An object of HTTP headers (key-value) to be set in the request
d) form: An object containing key-value form data
Creating Project
First we need to find a space in our machine and create a folder. We can name the folder whatever we want. Open Visual Studio Code, navigate to particular folder location which we created using cd command in the terminal of VS code. Run the below command to create package.json file.
Code:
npm init
Answer the questions presented, and you will end up with a package.json that looks like this:
Code:
{
"name": "android-node-server",
"version": "1.0.0",
"description": "It is a server for HMS Push Notification Kit",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Sanghati",
"license": "ISC"
}
We need to run the above command when we start a new project. Also whatever tools we install in this project, a dependency will be added in the package.json file and we use the below command to install our dependencies in node_modules folder.
Code:
npm install
We may need to run this every time we manually add a dependency to our package.json file.
Install Express
We run the below command to install Express js in our project.
Code:
npm install express –save
--save, will ensure to add express dependency to our package.json file.
Create app.js file
To create app.js file using VS code terminal we need touch. Touch command creates an empty file if it doesn’t exist. Run the below command to create app.js file.
Code:
npm install -g touch-cli
touch app.js
More details, you can visit https://forums.developer.huawei.com/forumPortal/en/topic/0204400319008240095
Previously, I've introduced how to quickly report app events to Google Analytics using DTM without releasing app updates. Now, the visual event tracking requirement has changed to report events to Firebase for multi-dimensional data analysis. The following uses a case to explain the process of reporting events to Firebase using DTM.
Case:
Report the $AddProduct2Cart event to Firebase using DTM.
Procedure:
1. Preparations
Before modifying the DTM configuration, ensure that you have completed the following preparations:
a. The DTM SDK has been integrated into the app.
b. The Firebase SDK has been integrated into the app.
c. The $AddProduct2Cart event has been configured for the app using the Analytics SDK.
Code:
Bundle bundle = new Bundle();
bundle.putString(PRODUCTID, "xxx");
bundle.putString(PRODUCTNAME, "xxx");
HiAnalytics.getInstance(context).onEvent(HAEventType.ADDPRODUCT2CART, bundle);
</p>
2. Modifying the DTM Configuration.
2.1 Creating a Variable
Go to Grow > Dynamic Tag Manager > Variable. Click Configure, select Event Name, and click OK.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2.2 Creating a Tag.
On the Tag page, click Create to create a Firebase tag. Configure the tag as follows:
Name: Enter a custom tag name.
Extension: Select Google Analytics (Firebase).
Event name: This parameter is optional. Select the check box and enter the renamed event name AddProduct2Cart (events reported to Firebase cannot contain the dollar sign $).
Parameters for addition: Set Key to price and Value to 1000.
Set Trigger condition to the created condition.
3. Creating and Releasing a Version.
Create and release a new configuration version on the Version page. The app with the DTM SDK integrated will periodically check and download the latest configuration version and report events according to this version.
In the Create version dialog box, select Create and release version.
4. Viewing the Reported Event on Firebase.
After completing the preceding operations, you can view the reported event on Firebase.
By default, the DTM SDK checks and downloads the latest configuration version at an interval of 6 hours. To download the latest configuration version immediately, clear the app cache and restart the app. DTM will not report events immediately if the debug mode is not enabled. Instead, events are reported every 10 minutes when the app is running. To report events immediately, run the following ADB commands:
Code:
adb shell setprop debug.huawei.hms.dtm.app <package_name>
adb shell setprop debug.firebase.analytics.app <package_name>
There may be a delay of several minutes for Firebase to receive the renamed event AddProduct2Cart triggered in the app.
Go to Analytics > DebugView to view the latest reported events.
The reported event name is AddProduct2Cart. The event has the price parameter and the parameter value is 1000, which is consistent with that set in DTM. This means that the DTM configuration has taken effect.
To learn more, please visit:
Our official website
Our development documentation page to find the documents you need
Reddit to join our developer discussion
GitHub or Gitee to download the demo and sample code
Stack Overflow to solve any integration problems
Original Source