Configuring App Information in AppGallery Connect - Huawei Developers

This thread describes the preparation procedures for configuring your app information in AppGallery Connect.
1. Configuring App Information in AppGallery Connect
Before you start developing an app, configure app information in AppGallery Connect.
1.1 Registering as a Developer
Before you get started, you must register as a HUAWEI developer and complete identity verification on the HUAWEI Developer website. For details, please refer to Register a HUAWEI ID.
1.2 Creating an App
Create an app by referring to Creating a Project and Creating an App in the Project. Special configurations for a game app are as follows:
l Platform: Select Android.
l Device: Select Mobile phone.
l App category: Select App.
1.3 Generating a Signing Certificate Fingerprint
A signing certificate fingerprint is used to verify the authenticity of an app when it attempts to access an HMS Core through the HMS SDK. Before using the HMS Core, you must locally generate a signing certificate fingerprint and configure it in AppGallery Connect.
Please ensure that the following conditions are met:
l You have created the app's signature file.
l The JDK has been installed on your PC.
Perform the following steps:
1. Open the command line tool (using the cmd command) and run the cd command to go to the directory where keytool.exe is located. In the following example, the Java program is installed in Program Files (x86) in the C drive.
{
"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. Run keytool -list -v -keystore <keystore-file> and respond as prompted.
In the preceding command, <keystore-file> is the complete path to the app's signature file.
Example:
Code:
C:\Program Files (x86)\Java\jdk1.7.0_25\bin>keytool -list -v -keystore
E:\HMS_SDK_2.5.1.300\Sample\HMSSdkSample_2.5.1.300_AS\HmsSample\android.keystore.jks
3. Obtain the SHA-256 fingerprint from the result.
1.4 Configuring the Signing Certificate Fingerprint
Sign in to AppGallery Connect and select My projects.
Find your project from the project list and click the app on the project card.
On the Project Setting page, set SHA-256 certificate fingerprint to the SHA-256 fingerprint that is generated from the preceding section of Generating a Signing Certificate Fingerprint.
4. After completing configuration, click the check mark.
1.5 Enabling Required Services
l To use the Drive service, you must also enable the Account and Push services.
For details, please refer to Enabling Services.

Related

HUAWEI Drive Kit Development Process (Part*1)

More information like this, you can visit HUAWEI Developer Forum​
Hey Dear Developers,
Do you have any questions with HUAWEI Drive Kit developing process?
If YES, here will give you some help.
HUAWEI Drive Kit ("Drive Kit") allows you to create apps that use the HUAWEI Drive Kit service.
Drive Kit provides cloud storage for your apps, enabling users to store files that are created while using your apps, including photos, videos, and documents, in HUAWEI Drive ("Drive") as well as download, synchronize, share, search for, and comment on these files and reply to comments.
Drive Kit also provides comprehensive data protection, empowering users to manage their data securely and conveniently.
The current core capabilities of Drive Kit include uploading, downloading, and searching for files in Drive, commenting on files, replying to comments, querying file changes, and receiving notifications.
The figure below shows the development process, and the red area represents the preparations procedures (step 1- preparations).
{
"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"
}
Furthermore, the preparation procedures will be divided into 3 parts:
1. Configuring App information in AppGallery Connect (mandatory procedures);
2. Preparing for client development;
3. Preparing for server development.
Before you start developing an app, configuring App information in AppGallery Connect (mandatory procedures):
l Registering as a Developer:
Before you get started, you must register as a HUAWEI developer and complete identity verification on the HUAWEI Developer website. For details, please refer to Register a HUAWEI ID.
l Creating an App:
Create an app by referring to Creating an App at the AppGallery Connect and upload a temporary APK.
Set the following parameters as described:
Ø Package type: APK (Android app)
Ø Device: Mobile phone
Ø App category: App
NOTICE:
AppGallery Connect reads the temporary APK to obtain the app package name. Therefore, the temporary APK name must be the same as the released APK name.
l Generating a Signing Certificate Fingerprint:
A signing certificate fingerprint is used to verify the authenticity of an app when it attempts to access an HMS Core service through the HMS SDK. Before using the HMS service, you must locally generate a signing certificate fingerprint and configure it in AppGallery Connect.
Please ensure that the following conditions are met:
Ø You have created the app's signature file.
Ø The JDK has been installed on your PC.
Perform the following steps:
Ø Open the command line tool (using the cmd command) and run the cd command to go to the directory where keytool.exe is located.In the following example, the Java program is installed in Program Files (x86) in the C drive.
Ø Run keytool -list -v -keystore <keystore-file> and respond as prompted.
In the preceding command, <keystore-file> is the complete path to the app's signature file.
Example:
Code:
C:\Program Files (x86)\Java\jdk1.7.0_25\bin>keytool -list -v -keystore
E:\HMS_SDK_2.5.1.300\Sample\HMSSdkSample_2.5.1.300_AS\HmsSample\android.keystore.jks
Ø Obtain the SHA-256 fingerprint from the result.
Configuring the Signing Certificate Fingerprint:
1.Sign in to AppGallery Connect and select My apps.
2.Find your app from the list and click the link under Android App in the Mobile phone column.
3.Go to Develop > Overview > App information and set SHA-256 certificate fingerprint to the SHA-256 fingerprint that is generated from the preceding section of Generating a Signing Certificate Fingerprint.
4.After completing configuration, click √
Enabling Required Services:
1.Log on to AppGallery Connect and select My apps.
2.Click the product to which your app belongs. The app information page is displayed.
3.Click the Develop tab, click the icon next to Overview, and then select Manage APIs.
4.Enable the required services.
For more details, please refer to Enabling Services.
'Preparing for client development & server development' are coming soon…
More information:
https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/drivekit-introduction

What Can I Do When Result Code 6003 Is Returned ?

When I integrate the HMS Core SDK into my app or game, result code 6003 is always returned during an API call. The official document indicates that this fault is caused by an incorrect signing certificate fingerprint. A signing certificate fingerprint is used to verify the app authenticity.
To locate the fault, perform the following operations:
Ensure that the app's certificate signature is the same as that configured in AppGallery Connect.
Ensure that the appid parameter in the manifest file is correct.
Check whether the app is hardened or re-signed.
Check whether HUAWEI App Signing is enabled.
Step 1: Ensure that the app's certificate signature is the same as that configured in AppGallery Connect.
Open the APK file of the app, extract the META-INF directory from the file, obtain the CERT.RSA file in the directory, and run the keytool -printcert -file META-INF/CERT.RSA command to display the signature certificate information.
Check the SHA-256 certificate fingerprint configured in AppGallery Connect by referring to Configuring the Signing Certificate Fingerprint. If the information is the same as the preceding information displayed, the certificate fingerprint is correct.
{
"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"
}
Note: The keystore signature of the debug version for packaging. Use the official version for packaging and utilize a real device (non-simulator) for testing only.
Step 2: Ensure that the appid parameter in the manifest file is correct.
You can perform the check in either of the following ways:
View the parameter directly in the manifest file under the project.
Decompile the packaged APK file, and view the parameter. You can use any decompliation tool for that.
Step 3: Check whether the app is hardened or re-signed.
Since AppGallery Connect does not re-sign an app currently, you need to locate the fault if your app has been hardened or re-signed by yourself.
Step 4: Check whether HUAWEI App Signing is enabled.
Huawei provides the App Signing service for developers to let Huawei host their app's signature key and use it for the APK file to be distributed.
According to the official document, if the service is enabled, the generated certificate fingerprint must be added in AppGallery Connect.

Integrating HUAWEI Game Service Based on Cocos SDKHub - Integrating Cocos SDKHub

1. Creating a Game on the Cocos Console
Create a game on the Cocos console as instructed (https://account.cocos.com/#/game/game_list).
{
"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. Creating a Game in HUAWEI AppGallery Connect
Step 1: Create a project in AppGallery Connect and add your app to the project.
Set Platform to Android, Device to Mobile phone, and App category to App or Game based on your needs.
Step 2: Configure the signing certificate fingerprint.
Go to Project settings > General information. In the App information area, click the icon next to SHA-256 certificate fingerprint, and enter the obtained SHA-256 certificate fingerprint.
Step 3: Enable the services you need.
Go to My projects > Project settings > Manage APIs, and enable the APIs you need to use.
If your app includes in-app purchases, go to Earn > In-App Purchases, and click Settings to enable HUAWEI IAP.
Step 4: (Optional) Configure achievements and events for your game.
For details, see the official documentation.
3. Associating a Game in Cocos Creator
You can enable third-party services for your app in Cocos Creator. But first, you need to set a Cocos AppID. Select a created game, and click Association, as shown in the following figures.
4. Integrating Cocos SDKHub
After Cocos SDKHub is integrated, you can run the sdkhub command in Developer Tools to access related APIs and functions.
5. Configuring Cocos SDKHub
1. Configuring a plug-in: Click Config Plugin, select the Huawei services to be enabled, and click OK.
2. Setting parameters: Click the following button and set parameters in the dialog box that is displayed.
Obtain the payment public key from Earn > In-App Purchases in AppGallery Connect.
Now that you have integrated Cocos SDKHub, you can develop your game in the Cocos development environment.
Next time, we'll take a look at how to package and release an app in AppGallery Connect.
For more details, check:
AppGallery Connect documentation:
https://developer.huawei.com/consumer/en/doc/distribution/app/agc-create_app
Cocos SDKHub Quick Start:
https://docs.cocos.com/creator/manual/en/cocos-service/sdkhub.html

Integrating HUAWEI Game Service Based on Cocos SDKHub - Packaging and Releasing

You can release a Cocos-based game in HUAWEI AppGallery Connect.
1. Building Your Version
Sign in to Cocos Creator, choose Project > Build & Release, and perform configurations as follows:
Select HUAWEI AppGallery Connect as the release platform.
For a joint operations app or game, the package name must end with*.huawei.
Use the keystore information configured previously.
In Cocos SDKHub, select the HUAWEI AppGallery Connect config set you need.
You are advised to deselect Debug Mode. All Huawei SDK APIs require app signature verification, if Debug Mode is selected, the compiler does not sign your app package by default.
2. Compiling Your Version
You can either compile your game in Cocos Creator or Android Studio.
2.1 Compiling in Cocos Creator
In Cocos Creator, go to Project > Build…, and click Compile after the build is complete.
After compilation, you can find the file in $ProjectHome\build\jsb-link\publish\android.
{
"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 Compiling in Android Studio
Open the following directory in Android Studio and compile your game.$ProjectHome \build\jsb-link\frameworks\runtime-src\proj.android-studio
3. Uploading Your Version
You can release your game version either by uploading it in Cocos Creator directly after build and compilation, or by uploading the compiled file in AppGallery Connect.
Method 1: Click Upload next to Compile in Cocos Creator. Select a login type, and enter the app ID of your game, which was generated by AppGallery Connect. You can set other parameters according to the actual situation. Click Confirm, and verify your HUAWEI ID in the displayed dialog box. After verification, your game version will be uploaded to AppGallery Connect. You can later sign in to AppGallery Connect and go to My apps > Distribute > Version information to view it.
Method 2: Sign in to AppGallery Connect, go to My apps > Distribute > Version information, click Software package management, and upload your app package.
For more details, check:
Integrating HUAWEI Game Service Based on Cocos SDKHub - Integrating Cocos SDKHub:https://forums.developer.huawei.com/forumPortal/en/topic/0203404602609800136
AppGallery Connect documentation:https://developer.huawei.com/consumer/en/doc/distribution/app/agc-release_app

Analyzing and Solving Error 907135701 from HMS Core Account Kit

907135701 is one of the most frequently reported error codes from HMS Core Account Kit. The official document describes the error as follows.
{
"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"
}
Both an Android project and a HarmonyOS project can report this error.
I myself have come across it several times and have summed up some of the causes and solutions for it, as follows.
From an Android Project​Cause 1: The app information is not configured in AppGallery Connect, and the app ID is not generated.
Solution: Configure the app information in AppGallery Connect.
To do this, first register as a Huawei developer and complete identity verification on HUAWEI Developers, as detailed here. Create a project and an app as needed and then obtain the app ID in AppGallery Connect.
Cause 2: The sign certificate fingerprint is not configured or incorrectly configured.
Solution: Verify that the fingerprint configured in AppGallery Connect and the fingerprint used during app packaging are consistent. You can configure the fingerprint by referring to this document.
Cause 3: agconnect-services.json is incorrectly configured, or this file is not placed in the correct directory.
Solution: Verify that the app IDs in agconnect-services.json and AppGallery Connect are the same, and copy the file to the app directory.
Also note that unless necessary, do not toggle on Do not include key in AppGallery Connect.
To re-configure the file, follow the instructions here.
From a HarmonyOS (Java) Project​Cause 1: agconnect-services.json is not placed in a proper directory.
Solution: Move the file to the entry directory.
Cause 2: The sign certificate fingerprint is not configured or incorrectly configured.
Solution: Verify that the fingerprint is configured as specified in Configuring App Signing. After obtaining the fingerprint, verify that it is consistent with that in AppGallery Connect.
Cause 3: The attribute configuration of config.json is incorrect.
Solution: Add the following content to module in the entry/src/main/config.json file of the HarmonyOS app. Do not change the value of name.
Code:
"metaData": {
"customizeData": [
{
"name": "com.huawei.hms.client.appid",
// Replace OAuth Client ID with your actual ID.
"value": "OAuth Client ID" //
}
]
}
Cause 4: The plugin configuration is incorrect.
Solution: Add the AppGallery Connect plugin configuration through either of these methods:
Method 1: Add the following configuration under the declaration in the file header:
Code:
apply plugin: 'com.huawei.agconnect'
Method 2: Add the plugin configuration in the plugins block.
Code:
plugins {
id 'com.android.application'
// Add the following configuration:
id 'com.huawei.agconnect'
}
References​HMS Core Account Kit home page
HMS Core Account Kit Development Guide

Categories

Resources