{
"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
Hello everyone ,
I will introduce you App Gallery Connect A/B Testing in this article. I hope this article will be help you in yours projects
Service Introduction
A/B Testing provides a collection of refined operation tools to optimize app experience and improve key conversion and growth indicators. You can use the service to create one or more A/B tests engaging different user groups to compare your solutions of app UI design, copywriting, product functions, or marketing activities for performance metrics and find the best one that meets user requirements. This helps you make correct decisions.
Implementation Process
Enable A/B Testing.
Create an experiment.
Manage an experiment.
1. Enable A/B Testing
1.1. Enable A/B Testing
First of all you need to enable A/B Testing from AG Connect .
Process:
1. Sign in to AppGallery Connect and click My projects.
2. In the project list, find your project and click the app for which you need to enable A/B Testing.
3. Go to Growing > A/B Testing.
4. Click Enable now in the upper right corner.
5. (Optional) If you have not selected a data storage location, set Data storage location and select distribution countries/regions in the Project location area, and click OK.
After the service is enabled, the page shown in the following figure is displayed.
2. Creating An Experiment
2.1. Creating a Remote Configuration Experiment
Enable A/B Testing
Go to AppGallery Connect and enable A/B Testing.
Access Dependent Services
Add the ‘implementation ‘com.huawei.hms:hianalytics:{version}’ to build.gradle
Procedure
1. On the A/B Testing configuration page, click Create remote configuration experiment.
2. On the Basic information page, enter the experiment name, description, and duration, and click Next.
3. On the Target users page, set the filter conditions, percentage of test users, and activation events.
a. Select an option from the Conditions drop-down list box. The following table describes the options.
b. Click New condition and add one or more conditions.
c. Set the percentage of users who participate in the experiment.
d. (Optional) Select an activation event and click Next.
4. On the Treatment & control groups page, click Select or create, add parameters, and set values for the control group and treatment group.
5. After the setting is complete, click Next.
6. On the Track indicators page, select the main and optional indicators to be tracked.
7. Click Save. The experiment report page is displayed.
2.2. Creating a Notifications Experiment
Enable A/B Testing
Go to AppGallery Connect and enable A/B Testing.
Access Dependent Services
Add the ‘implementation ‘com.huawei.hms:hianalytics:{version}’ to build.gradle
Procedure
1. On the A/B Testing configuration page, click Create notifications experiment.
2. On the Basic information page, enter the experiment name and description and click Next.
3. On the Target users page, set the filter conditions and percentage of test users.
a. Set the Audience condition based on the description in the following table.
b. Click New condition and add one or more audience conditions.
c. Set the percentage of users who participate in the experimentand click Next.
4. On the Treatment & control groups page, set parameters such as Notification title, Notification content, Notification action, and App screen in the Set control group and Set treatment group areas. After the setting is complete, click Next.
5. On the Track indicators page, select the main and optional indicators to be tracked and click Next.
6. On the Message options page, set Push time, Validity period, and Importance. The Channel ID parameter is optional. Click Save.
7. Click Save. The experiment report page is displayed.
3. Managing An Experiment
You can manage experiments as follow
Test the experiment.
Start the experiment.
View the experiment report.
Increase the percentage of users who participate in the experiment.
Release the experiment.
Perform other experiment management operations.
3.1 Test The Experiment
Before starting an experiment, you need to test the experiment to ensure that each treatment group can be successfully sent to test users.
Process
Go to the A/B Testing configuration page and find the experiment to be tested in the experiment management list.
Click Test in the Operation column.
3. Add test users.
If you have not test account you need to create one.
If you have test account you need to select experiments and keep going.
3.2 Start The Experiment
After verifying that a treatment group can be delivered to test users, you can start the experiment.
Process:
Go to the A/B Testing configuration page and find the experiment to be started in the experiment management list.
2. Click Start in the Operation column and click OK.
After the experiment is started, its status changes to Running.
Guide:
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-abtest-start-experiment
3.3 View The Experiment Report
You can view experiment reports in any state. For example, to view the report of a running experiment.
Process:
Go to the A/B Testing configuration page and find the experiment to be viewed in the experiment management list.
Click View report in the Operation column. The report page is displayed.
Displayed Reports:
3.4 Increase The Percentage of Users Who Participate In The Experiment
You can view experiment reports in any state. For example, to view the report of a running experiment
Process:
1. Go to the A/B Testing configuration page and find the experiment whose scale needs to be expanded in the experiment management list.
2. Click Improve in the Operation column.
3. In the displayed dialog box, enter the target percentage and click OK.
3.5 Releasing an Experiment
You can release a running or finished remote configuration experiment.
3.5.1 Releasing a Remote Configuration Experiment
Process:
1. Go to the A/B Testing configuration page and find the experiment to be released in the experiment management list.
2. Click Release in the Operation column.
3. Select the treatment group to be released, set Condition name, and click Go to remote configuration.
You can customize the condition name meeting the requirements.
4. The Remote Configuration page is displayed. Click Parameter Management and Condition management to confirm or modify the parameters and configuration conditions, and click Release.
3.5.2 Releasing a Notification Experiment
1. Go to the A/B Testing configuration page and find the experiment to be released in the experiment management list.
2. Click Release in the Operation column.
3. Select the treatment group to be released and click Release message.
3.6 Other Experiment Management Operations
3.6.1 Viewing an Experiment
You can view experiments in any state.
1. Go to the A/B Testing configuration page and find the experiment to be viewed in the experiment management list.
2. Click View details in the Operation column.
3.6.2 Copying an Experiment
You can copy an experiment in any state to improve the experiment creation efficiency.
1. Go to the A/B Testing configuration page and find the experiment to be copied in the experiment management list.
2. Click Duplicate in the Operation column.
3.6.3 Modifying an Experiment
You can modify experiments in draft state.
1. Go to the A/B Testing configuration page and find the experiment to be modified in the experiment management list.
2. Click Modify in the Operation column.
3. Modify the experiment information and click Save.
3.6.4 Stopping an Experiment
You can stop a running experiment.
1. Go to the A/B Testing configuration page and find the experiment to be stopped in the experiment management list.
2. Click Stop in the Operation column and click OK.
After the experiment is stopped, the experiment status changes to Finished.
3.6.4 Deleting an Experiment
You can delete an experiment in draft or finished state.
1. Go to the A/B Testing configuration page and find the experiment to be deleted in the experiment management list.
2. Click Delete in the Operation column and click OK.
Resources
Enabling A/B Testing :
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-abtest-enable-ABtest
Creating a Remote Configuration Experiment
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-abtest-create-remoteconfig
Creating a Notification Experiment :
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-abtest-create-notification
Managing an Experiment :
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-abtest-manage-overview
Related Links
Thanks to Bayar Şahintekin for this article.
Original post: https://medium.com/huawei-developers/huawei-app-gallery-connect-a-b-testing-cc3147e9b967
Nice article
Is Huawei AB testing better than google firebase AB testing?
Related
More articles like this, you can visit HUAWEI Developer Forum
HUAWEI Analytics Kit 5.0 version has been updated, and it supports iOS SDK now, enabling one-stop, unified analysis of cross-platform Android and iOS users. It looks into user-centric analysis and helps you understand user behavior on the Android and iOS platforms. Today I want to share with you how to add Analytics Kit to your iOS App. The version I integrated is 5.0.0.300.
The general steps we will walk through include:
Configuring App Information in AppGallery Connect
Integrating the HMS Core SDK
Accessing HUAWEI Analytics Kit
Configuring App Information in AppGallery Connect
Follow the steps below to configure App Information in AppGallery Connect for your iOS application. If you have both an Android and an iOS version of your app, you can set them within the same project, this will allow you to finish the data analysis conveniently.
{
"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"
}
Getting Started:
1. Have your Bundle ID ready for your iOS app (ask your developers for this).
2. Go to AppGallery Connect and create a new project.
Once you’ve created a new project, you’ll see a page, and the side navigation bar shows the AGC's various function menus.
3. Click Add app, and create an iOS application.
Here the App package ID is the Bundle ID.
Click OK, and then you will get the configuration file agconnect-services.plist.
Click Manage APIs, and here we’ve already had the Analytics API enabled.
Back to the side navigation bar, and go to the HUAWEI Analytics tab, you will see all kinds of functions, including User analysis, Behavior analysis, etc. Select any menu to Enable Analytics service.
On the Project access settings page, set the data storage location, time zone, currency, user data storage time, and calendar week, and click Finish.
Integrating the HMS Core SDK (in Cocoapods Mode)
I prefer the Cocoapods Mode. You can also integrate the HMS Core SDK into the Xcode Project Manually.
1. Add the AppGallery Connect configuration file of the app to your XCode project.
a. Click Download agconnect-services.plist to obtain your iOS config file (agconnect-services.plist).
b. Move your agconnect-services.plist file into the root of your Xcode project.
2. Edit the Podfile file
a. Create a Podfile if you don't already have one:
$ cd your-project-directory
$ pod init
b. To your Podfile, add the pods that you want to use in your app: Add pod 'HiAnalytics', that is, the dependency for pod.
Example Podfile file:
Code:
# Uncomment the next line to define a global platform for your project
# platform :iOS, '9.0'
target 'HiAnalyticsSwiftDemo' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for HiAnalyticsSwiftDemo
pod 'HiAnalytics'
target 'HiAnalyticsSwiftDemoUITests' do
# Pods for testing
end
end
c. Install the pods, then open your .xcworkspace file to see the project in Xcode:
$ pod install
$ open your-project.xcworkspace
Accessing HUAWEI Analytics Kit
1. Initialize Analytics SDK in your app
The final step is to add initialization code to your application. Initialize AppDelegate through the config interface.
Objective C sample code: Perform initialization in AppDelegate.m.
Code:
#import "AppDelegate.h"
#import <HiAnalytics/HiAnalytics.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
...
- (BOOL)Application:(UIApplication *)Application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after Application launch.
[HiAnalytics config];//Initialization
return YES;
}
...
@end
Swift code example: Perform initialization in AppDelegate.swift.
Code:
import UIKit
import HiAnalytics
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
...
func Application(_ Application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after Application launch.
HiAnalytics.config();//Initialization
return true
}
...
}
2. Record defined events using the onEvent API.
For definitions of the events, please refer to Event Description.
3. Call APIs of HUAWEI Analytics Kit to implement the corresponding functions. For details, please refer to API Reference.
During the development, you can use DebugView to view the event records in real time, observe the results, and adjust the event tracing scheme.
Enabling/Disabling the Debug Mode
1.To enable the debug mode:
Go to Product > Scheme > Edit Scheme from the Xcode menu. On the Arguments page, click + to add the -HADebugEnabled parameter. After the parameter is added, click Close to save the setting.
Code:
1. –HADebugEnabled
2.To disable the debug mode
Code:
1. -HADebugDisabled
After the data is successfully reported, you can go to HUAWEI App Debugging to view the data, as shown in the following figure.
Q&A:
1. I have integrated the iOS SDK of HUAWEI Analytics Kit into my app but why no log events are collected when the app is running?
When this problem occurs, it is probable that the run log parameters have not been set. You can set the log level to any of the following values: -HALogLevelDebug, -HALogLevelInfo, -HALogLevelWarn, and -HALogLevelError.
For example, to set the log level to -HALogLevelDebug, perform the following steps:
Choose Product > Scheme > Edit Scheme from the Xcode menu.
On the Arguments page, click + to add the -HALogLevelDebug parameter.
After the parameter is added, click Close to save the setting.
Face problems during development? Take it easy. Go to Stack Overflow and raise your questions. Huawei experts will get back to you as soon as possible.
https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Newest
According to the introduction of Cocos Creator from its official website, Cocos Creator 2.4.1 and later versions support HUAWEI AppGallery Connect and have been providing multiple AppGallery Connect services. The following figure shows all supported AppGallery Connect services.
{
"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"
}
To test how well Cocos supports AppGallery Connect services, this article uses the App Performance Management (APM) service as an example to monitor the performance data of a Cocos-developed app. First, let's see what APM is.
AppGallery Connect APM
APM of AppGallery Connect provides minute-level app performance monitoring capabilities. You can view and analyze app performance data collected by APM in AppGallery Connect to comprehensively understand the performance features of developed apps, helping you quickly and accurately rectify possible performance problems and continuously improve user experience.
That is, APM can help you monitor your app performance data in a variety of scenarios, including app launch, page loading, and network request. We can assume that APM can quickly locate performance-related problems for games, which attach great importance to performance as it greatly affects user experience.
Before You Start
Downloading and Installing the Cocos Dashboard
1. The Cocos Dashboard is the GUI-based development tool provided by Cocos. You can download it from https://www.cocos.com/creator/ (latest version: 2.4.2).
2. You need to install the Visual Studio as well to obtain the Cocos dependency package. The following figure shows the installation procedure.
3. After the installation is complete, click Run
Downloading and Installing Cocos Creator
1. Open the Cocos Dashboard and click Signin in the upper right corner. You can sign up first if you do not have an account.
2. After sign-in, click Editor on the left, and then click Download in the lower right corner.
3. On the Editor page, select the latest version of Cocos Creator, click the download button on the right, and agree with the terms.
4. Once the download is complete, you can create a Cocos project on the Project page. Take a HelloWorld project as an example.
5. When you open the project for the first time, the system prompts you to select a language. Just select English. Select the corresponding running environment and click Run.
Configuring the Visual Studio Code Compilation Environment
The built-in code editor of Cocos is too simple and is only suitable for code viewing and a small amount of editing. Therefore, we need a more mature and powerful compilation environment. This is where Visual Studio Code comes in.
1. Download and install Visual Studio Code of the required version based on your computer environment.
2. Open your project in Cocos Creator and choose Developer > VS Code Workflow > Install VS Code Extension from the main menu to add an adaptation plug-in to Cocos Creator.
3. If the information shown in the following figure is displayed, the installation is successful.
4. If you want the system to autocomplete the Cocos Creator engine API during coding, you need to generate the API autocompletion data and put the data in the project path through the menu. Choose Developer > VS Code Workflow > Update VS Code API Source.
5. Double-click the HelloWorld.js script in the project directory. In the dialog box that is displayed, click Yes and select Visual Studio Code as the default editor.
6. Double-click the HelloWorld.js script again to develop your app.
Packaging and Releasing a Cocos-based App in AppGallery Connect
Cocos Creator 2.4.1 and later versions allow you to package and release your app to HUAWEI AppGallery through AppGallery Connect. In addition, Cocos Creator suports various AppGallery Connect services, such as APM, which can be quickly integrated and used. The detailed procedure is as follows:
1. Sign in to AppGallery Connect and create an app.
2. Sign in to Cocos Creator, choose Project > Build…, and select HUAWEI AppGallery Connect as the release platform.
3. Click Build. If Built huawei-agc successfully is displayed, the build is successful.
Note: When you build a project for the first time, you need to choose File > Settings… and configure the Android SDK path and NDK path on the native development environment page.
4. Click Compile and wait until the compilation is successful.
5. A jsb-default or jsb-link directory (depending on the template selected on the Build… panel) is generated in the build directory of the default release path. AppGallery Connect services are automatically integrated in the directory. Open the publish directory in the jsb-link directory to view the generated APK file.
6. Upload the packaged APK file locally or using AppGallery Connect.
l Uploading the file on the Upload... panel.
a) Login Type: OAuth
Click Confirm, sign in to your HUAWEI ID (with sufficient permissions), and select the check box of the corresponding permissions. The APK file will be uploaded automatically.
b) Login Type: API Client
Sign in to AppGallery Connect to obtain related configuration. Go to Users and permissions > Connect API > Create, create an API client, select a role as required, and click OK.
Enter your client ID and key of the API client in the text boxes on the Upload... panel in Cocos Creator. Click Confirm.
After the APK file is uploaded successfully, you can view it in AppGallery Connect.
Uploading the file in AppGallery Connect
Click Upload and select the APK generated by Cocos Creator.
For more details, please refer to:
Cocos official documents
AppGallery Connect APM development guide
AppGallery Connect console
GitHub to download demos and sample codes
Stack Overflow to solve any integration problems
According to the introduction of Cocos Creator from its official website, Cocos Creator 2.4.1 and later versions support HUAWEI AppGallery Connect and have been providing multiple AppGallery Connect services. The following figure shows all supported AppGallery Connect services.
{
"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"
}
To test how well Cocos supports AppGallery Connect services, this article uses the App Performance Management (APM) service as an example to monitor the performance data of a Cocos-developed app. First, let's see what APM is.
AppGallery Connect APM
APM of AppGallery Connect provides minute-level app performance monitoring capabilities. You can view and analyze app performance data collected by APM in AppGallery Connect to comprehensively understand the performance features of developed apps, helping you quickly and accurately rectify possible performance problems and continuously improve user experience.
That is, APM can help you monitor your app performance data in a variety of scenarios, including app launch, page loading, and network request. We can assume that APM can quickly locate performance-related problems for games, which attach great importance to performance as it greatly affects user experience.
Before You Start
Downloading and Installing the Cocos Dashboard
The Cocos Dashboard is the GUI-based development tool provided by Cocos. You can download it from (latest version: 2.4.2).
2. You need to install the Visual Studio as well to obtain the Cocos dependency package. The following figure shows the installation procedure.
3. After the installation is complete, click Run
Downloading and Installing Cocos Creator
1. Open the Cocos Dashboard and click Signin in the upper right corner. You can sign up first if you do not have an account.
2. After sign-in, click Editor on the left, and then click Download in the lower right corner.
3. On the Editor page, select the latest version of Cocos Creator, click the download button on the right, and agree with the terms.
4. Once the download is complete, you can create a Cocos project on the Project page. Take a HelloWorld project as an example.
5. When you open the project for the first time, the system prompts you to select a language. Just select English. Select the corresponding running environment and click Run.
Configuring the Visual Studio Code Compilation Environment
The built-in code editor of Cocos is too simple and is only suitable for code viewing and a small amount of editing. Therefore, we need a more mature and powerful compilation environment. This is where Visual Studio Code comes in.
1. Download and install Visual Studio Code of the required version based on your computer environment.
2. Open your project in Cocos Creator and choose Developer > VS Code Workflow > Install VS Code Extension from the main menu to add an adaptation plug-in to Cocos Creator.
3. If the information shown in the following figure is displayed, the installation is successful.
4. If you want the system to autocomplete the Cocos Creator engine API during coding, you need to generate the API autocompletion data and put the data in the project path through the menu. Choose Developer >
VS Code Workflow > Update VS Code API Source.
5. Double-click the HelloWorld.js script in the project directory. In the dialog box that is displayed, click Yes and select Visual Studio Code as the default editor.
6. Double-click the HelloWorld.js script again to develop your app.
Packaging and Releasing a Cocos-based App in AppGallery Connect
Cocos Creator 2.4.1 and later versions allow you to package and release your app to HUAWEI AppGallery through AppGallery Connect. In addition, Cocos Creator suports various AppGallery Connect services, such as APM, which can be quickly integrated and used. The detailed procedure is as follows:
1. Sign in to AppGallery Connect and create an app.
2. Sign in to Cocos Creator, choose Project > Build…, and select HUAWEI AppGallery Connect as the release platform.
3. Click Build. If Built huawei-agc successfully is displayed, the build is successful.
Note: When you build a project for the first time, you need to choose File > Settings… and configure the Android SDK path and NDK path on the native development environment page.
4. Click Compile and wait until the compilation is successful.
5. A jsb-default or jsb-link directory (depending on the template selected on the Build… panel) is generated in the build directory of the default release path. AppGallery Connect services are automatically integrated in the directory. Open the publish directory in the jsb-link directory to view the generated APK file.
6. Upload the packaged APK file locally or using AppGallery Connect.
Uploading the file on the Upload… panel.
a) Login Type: OAuth
Click Confirm, sign in to your HUAWEI ID (with sufficient permissions), and select the check box of the corresponding permissions. The APK file will be uploaded automatically.
b) Login Type: API Client
Sign in to AppGallery Connect to obtain related configuration. Go to Users and permissions > Connect API > Create, create an API client, select a role as required, and click OK.
Enter your client ID and key of the API client in the text boxes on the Upload… panel in Cocos Creator. Click Confirm.
After the APK file is uploaded successfully, you can view it in AppGallery Connect.
Uploading the file in AppGallery Connect
Click Upload and select the APK generated by Cocos Creator.
great
It's very useful. Recently, our Cocos project is focusing on Huawei AppGallery.
We've introduced how to integrate AppGallery Connect Crash to an Android app. The integration procedure for an iOS app is similar. Let's take a look. you can also download the codelab to integrate.
Creating Your Project and App
First, you need to create a project in AppGallery Connect and add an app to it. For details, see the AppGallery Connect documentation.
Enabling HUAWEI Analytics
The Crash service uses capabilities of HUAWEI Analytics when reporting crash events. Therefore, you must enable HUAWEI Analytics before integrating the Crash SDK. For details, please refer to the AppGallery Connect documentation.
Integrating SDKs
If you are using Xcode, you can integrate the Crash SDK into your Xcode project with CocoaPods.
1. Sign in to AppGallery Connect and click My projects.
2. Find the project you created from the project list, and click the app for integration on the project card.
3. Go to Project Settings > General information, and click agconnect-services.plist under App information to download the configuration file.
{
"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"
}
4. Add the agconnect-services.plist file to the Xcode project directory.
5. Create a Podfile.
Open the CLI and navigate to the location of the Xcode project. Then, create a Podfile. Skip this step if a Podfile already exists.
HTML:
cd project-directory
pod init
6. Edit the Podfile.
1) Integrate the Analytics SDK and the Crash SDK.
Edit the Podfile to add pod dependencies of HUAWEI Analytics and the Crash SDK.
HTML:
target 'demo' do
# Pods for demo
pod 'HiAnalytics'
pod 'AGConnectCrash'
end
end
2) Install the pod and open the*.xcworkspace file to view the project.
pod install
7. Initialize the AppGallery Connect SDK and Analytics SDK.
HTML:
Import header files to the AppDelegate.m file of the project and add code for initialization.
#import "AppDelegate.h"
#import <AGConnectCore/AGConnectCore.h>
#import <HiAnalytics/HiAnalytics.h>
[user=2052344]@impl[/user]ementation AppDelegate
- (BOOL)Application:(UIApplication *)Application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after Application launch.
[AGCInstance startup];// Initialization
[HiAnalytics config];// Initialization
return YES;
}
...
[user=994449]@End[/user]
Testing the Crash Service
Create a test button makecrash in your demo project, and tap the button to trigger a crash. You can drag and drop the button for creating it, which is simple. The result is as follows.
Call the testIt method provided by AppGallery Connect to trigger a crash.
In your Xcode simulator, install and run your app, and tap the makecrash button to trigger a crash.
Viewing a Crash Report
1. Sign in to AppGallery Connect, go to My projects, and find the app in which you triggered the crash.
2. Go to Quality > Crash. On the Crash page, click the Statistics tab to view crash statistics of your app. The crash information is displayed just 1 or 2 minutes after you run your app.
3. Click the Problems tab to view the crash of your app. For example, in the following figure, NSRangeException is the crash triggered during the test.
Click the crash to view its details.
Summary:
1、It is easy to integrate the Crash service. During testing, you can either write code yourself, or use the testIt method provided by AppGallery Connect.
2、Crash reports are available in only 1 or 2 minutes.
3、 All you need to write is just a few lines of code during testing. The service integration for app release is coding-free.
4、 The Crash service also provides features including restoring obfuscated reports and generating custom reports.
Reference documents
HUAWEI AppGallery Connect Crash documentation: https://developer.huawei.com/consum...Gallery-connect-Guides/agc-crash-introduction
Coding-free Integration of AppGallery Connect Crash into an Android App:
https://developer.huawei.com/consumer/en/forum/topic/0201387764119030047?fid=0101271690375130218
Codelab of Crash in iOS:
https://developer.huawei.com/consumer/en/codelab/CrashService-iOS/index.html#0
How much time it took to get reports on AGC console ?
sanghati said:
How much time it took to get reports on AGC console ?
Click to expand...
Click to collapse
It takes 3 to 5 minutes to generate a visualized report.
Wow, thank you for such a useful article. This information really helped me! I am not very well versed in application development, so I often make various mistakes. When I needed to urgently create an application for my project, I was looking for a service that could help me with this. It was very difficult to find a really cool service that could create exactly what I want. On the advice of my friend, I turned to www.cubycode.com and it was a real salvation for me. They did everything exactly as I wanted! Now I try to learn everything related to application development, as it will be very difficult for me without this skill. Thanks to posts like this, I was able to extract a lot of useful information and make fewer mistakes. Thanks!
It can be useful.
Ciceniss said:
Wow, thank you for such a useful article. This information really helped me! I am not very well versed in application development, so I often make various mistakes. When I needed to urgently create an application for my project, I was looking for a service that could help me with this. It was very difficult to find a really cool service that could create exactly what I want. On the advice of my friend, I turned to www.cubycode.com and it was a real salvation for me. They did everything exactly as I wanted! Now I try to learn everything related to application development, as it will be very difficult for me without this skill. Thanks to posts like this, I was able to extract a lot of useful information and make fewer mistakes. Thanks!
Click to expand...
Click to collapse
Thank you for your like. And crash service can reporting non-fatal exceptions now. you can try it to handle your mistake.
Rebis said:
It can be useful.
Click to expand...
Click to collapse
Thank you for your love. I hope you pay attention to my follow-up content.
Environment for Game Release and Testing
1. Have a Huawei mobile phone ready.
2. Connect that mobile phone to a PC using a data cable, and make sure that it remains connected during the game release.
The reason is that a Huawei quick game will not generate a QR code for release, so the data cable is needed during the release process. Otherwise, only one RPK package will be generated during game release in the LayaAir IDE, and you still need to connect the two devices and copy the RPK package to the mobile phone.
3. Install Node.js 10.x. You can download it here: https://nodejs.org/download/release/latest-v10.x/.
4. Install the LayaAir 2.8.1 IDE, or a later version. You can download it here: https://ldc2.layabox.com/layadownload/?type=layaairide.
Preparations
To ensure that your game release goes as smoothly as possible, make sure that you:
1. Have installed Node.js and LayaAir IDE on your PC. You do not need to install the ADB and OpenSSL, as they are built into the LayaAir IDE.
2. Have enabled the developer mode on your mobile phone, and allowed for USB debugging.
{
"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"
}
If you do not know how to enable the developer mode, you can check Huawei’s documentation at https://developer.huawei.com/consumer/en/doc/quickapp-open-developer-option.
Releasing a Huawei Quick Game in the LayaAir IDE
First, use the release function for the LayaAir IDE to package the Huawei quick game project to an RPK file. Then, open this project in the IDE and go to Project > Release. Select the release platform huawei fast game and set Minimum platform version(1075). Lastly, click publish to release your quick game.
I won’t describe the steps required for release in detail here. If you have any questions, please refer to the official website.
About the Certificate Fingerprint
If the release signature has been generated in the project, you can print the signing certificate fingerprint on the release page. This fingerprint will be used when you submit a Huawei quick game.
It’s important to note that the print button is only available after the release signature is generated. If no signature is generated, the message shown in the following figure will be displayed, indicating that the certificate does not exist.
Running and Testing the Game on a Real Device
After the game has been successfully released on LayaAir IDE, it will automatically run on the Huawei phone in full-screen mode. If you exit the game, you can also launch the Huawei Quick App Loader and tap the game name to restart the game.
Debugging the Game
No tool is available for debugging a Huawei quick game, so you’ll need to make sure that your browser supports the HTML5 version of the game. Debugging your Huawei quick game requires that you check its logs, so you’ll need to retain the default value log for the log level in LayaAir IDE, as shown in the figure below. In this case, both the LayaAir IDE logs and error logs will be recorded. If you set the log level to error, only error logs will be recorded. Both options allow you to view logs after the game’s release. If you select off, no logs will be available.
You can directly view logs on the project release page, as shown below.
You can also open another CLI on your PC to view logs by entering the following command. This method enables you to avoid keeping the IDE open for debugging for a long period.
adb logcat -s jsLog
All logs generated during runtime after the release are displayed in the CLI, as shown below.
If you would like to export logs, please use Huawei Quick App PC Assistant.
FAQs
1. Do Huawei quick games support package splitting?
Splitting the package of a Huawei quick game and loading its subpackages helps reduce the traffic and time required for app downloads. When doing so, you can choose to load or download specific subpackages, rather than the entire package.
Before using this method, you’ll need to determine whether this method is necessary for your project. Most quick game packages are small enough that they do not necessarily require splitting. You can opt to:
(1) Delete unnecessary JavaScript code.
If the package is not split, the JavaScript files referenced in the index.js and HTML files are packaged in the last RPK file, unless these JavaScript files are referenced elsewhere in the project. You can also directly delete the unused JavaScript files, for example, those of unused engine libraries and third-party class libraries, to reduce the package size.
(2) Compress and obfuscate JavaScript files.
This can significantly reduce the file size. If the file size does not exceed 4 MB, you won’t need to split the package, as game content can be dynamically loaded through URLs. After the content is loaded for the first time, it is stored in the physical cache. Common content that occupies less than 50 MB will not be reloaded the next time.
2. When a third-party library, for example, protobuf, is introduced, the gameThirdScriptError error is reported. What should I do?
A potential cause is that the library contains such code as Function(“return this”)();. For security purposes, the game engine disables such code by default. It is recommended that you modify the JavaScript code. In addition to protobuf, the following third-party libraries have similar code. If these libraries need to be introduced, you’ll need to modify the code as well.
If you do not modify the code, you’ll need to enable the runGame parameter, which is not recommended.
For more information, please refer to:
Huawei Quick App PC Assistant materials:
https://developer.huawei.com/consum...ickApp-Guides/quickapp-pcassistant-user-guide
Huawei quick game materials:
https://developer.huawei.com/consum...uickApp-Guides/quickgame-develop-runtime-game