HUAWEI Drive Kit Development Process (Part*1) - Huawei Developers

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

Related

Configuring App Information in AppGallery Connect

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.

Coding Assistant - Automatic Environment Configuration of Push Kit in One Click

More information like this, you can visit HUAWEI Developer Forum​
Introduction:
Coding Assistant provides HMS Core APIs and sample code. We only need to drag and drop scenario cards to integrate the corresponding scenarios. Here we can simply configure the Push Kit integration environment with one click, and the tool will automatically complete the configuration.
HMS Core Tool Kit Introduction:
HMS Core Tool Kit is a plug-in Installed in Android studio to facilitate app creation, coding, conversion, debugging, testing and release. It helps to integrate HMS Core API in the most efficient way and at the lowest possible cost.
To know more about HMS tool Kit and installation process use the Link.
Integrating Procedure:
Previously we may have needed to set many configuration items while integrating push Kit and have to check them repeatedly to avoid omission. To address this issue Huawei sorted the integration process and placed the configuration items into an automatic process. This is called the automatic environment configuration in one click mode.
So, click Start Configuration to initiate an automatic check whether configuration is required for integration to be completed. If not, some will automatically be completed while the rest will have to be processed as prompted. Click Retry to check whether all of the configuration items are completed. This ensures that the entire configuration process is clear and there are no omissions.
Development Based on Scenarios and Steps:
Huawei provides scenario-based and step-based development modes.
For scenario-based development, drag a scenario card to a project to automatically insert related code, configurations, and dependencies.
For step-based development, access a card to view the detailed steps and API code snippets of a scenario, and copy code snippets to a project.
Here we are using scenario-based development.
Steps for Integrating Push Kit Via Coding Assistant:
1. Go to HMS > Coding Assistant
{
"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. Login Via opened browser
3. Provide access permission
After log in, it will be redirected to HUAWEI Dev Eco Studio home Page.
Configuration Wizard
Configuration Wizard will help us to quickly complete the necessary preparations such as registering an app and generating a signing certificate fingerprint so that we do not spend more time.
1. To setup development environment, click Configuration.
2. In Configuration Wizard, select Choose your team name, Choose kit, Choose your module and Certificate to generate the fingerprint.
Click Start Enviornmrnt Check, as follows.
3. Click Go to environment configuration, as show in below image.
Note: To solve the issues in Environment Check as App Gallery Connect cannot locate your application, Data storage location has not been set yet etc.
4. Configuration Results will show details of failed steps. Go to each and every failed steps and click the corresponding Link.
5. Click Link, it will redirect to AppGallery.
Note: Here the first issue is there is no application in AppGallery with the same package name as the application created in Android Studio. So in AppGallery we have to create an application with the same package name. We can check Event Log and can verify which steps are executed successfully.
6. Create New project.
7. Click Add app in General Information for creating app
8. Enter App name, Package name, App category and Default language.
9. In Configuration Result, click Retry, it will provide new result and prompt to set data storage location.
10. After click on Link, it redirect to AppGallaery Conect and we need to set Data Storage Location.
11. Select Data Storage location.
12. In Configuration Result, click Retry, it will provide new Configuration Results.
It prompts to enable service manually.
13. In AppGallery Connect, click Enable now Huawei PushKit.
14. In Configuration Result, click Retry, it will provide new Configuration Results. It prompts to enable API.
15. In AppGallery Connect, Enable Push Kit API as shown below.
16. In Configuration Result, click Retry. Finally it will provide success message.
Note: Check Event Log and see the details.
17. In Configuration Results click Go to Coding Assistant.
This is not the end. For full content, you can visit https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201339927413030084&fid=0101188387844930001

Integration Practice | Sending Messages by HUAWEI Push Kit in Cocos

Cocos Creator has supported HMS Core and HUAWEI AppGallery Connect, through which you can quickly release your games with one click, reducing such complex operations as the SDK integration and app upload during development. In this way, you can build high-quality and innovative apps to improve game experience.
Based on this guide, you can learn how to send messages by Push Kit in Cocos step by step.
Procedure Overview
1. Create a game on the Cocos website, and create the game project in Cocos Creator.
2. Create an app and configure the app information in AppGallery Connect, configure Cocos SDKHub and the building flow, and add the HUAWEI_HMS (Push) plugin and select HUAWEI AppGallery Connect from SDKHub Configuration.
3. Perform coding to obtain a token and build an APK.
4. Test the function of sending notification messages and data messages.
Procedure Details
Step 1: Create a game on the Cocos website, and create the game project in Cocos Creator.
1. Visit https://passport.cocos.com/auth/signup, and sign in with a Cocos developer account. (If you have no account, register one.) Then create a game.
{
"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. Visit http://www.cocos2d-x.org/products#creator, and download and install Cocos Creator.
3. Start Cocos Creator, choose Project, and click New. In the window that is displayed, configure project information, and click Save. The project creation is completed.
If the following error occurs during creation, download Editor.
In Cocos Creator, choose Editor, select version 2.4.2 on the right, and click Download.
Step 2: Create an app and configure the app information in AppGallery Connect, configure Cocos SDKHub and the building flow, and add the HUAWEI_HMS (Push) plugin and select HUAWEI AppGallery Connect from SDKHub Configuration.
1. Create an app and configure the app information in AppGallery Connect by referring to the guide in https://developer.huawei.com/consum...re-Guides/android-config-agc-0000001050170137.
The key steps include:
Generating a signing certificate fingerprint
Configuring the signing certificate fingerprint
Setting a data storage location
Enabling required services
Downloading the agconnect-services.json file
After the app information configuration, perform configuration in Cocos Creator.
2. Choose Panel > Service.
3. Select your project.
Select Cocos SDKHub on the page that is displayed.
4. Click Plugin Manage.
5. Select Push and click OK. The page shown in the preceding figure is displayed.
6. Move the cursor to Not Configured in Params. The editing icon is displayed. Click it.
7. Select a required JSON file, and click OK.
8. Choose Project > Build.
The Build panel is displayed on the right.
9. Set SDKHub Configuration to HUAWEI AppGallery Connect, and click Build.
If the following error occurs during building, install NDK.
After the installation, click Compile. The progress status becomes completed.
Step 3: Perform coding to obtain a token and build an APK.
The following figure shows the project structure.
In Cocos Creator, select js-sdkhub.js file from Assets at the lower left corner.
More information, you can visit https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201368424613350372&fid=0101187876626530001
https://forums.developer.huawei.com/...87876626530001 This seems a new platform for asking integration questions about HMS. I will try this.
Sherlock F said:
https://forums.developer.huawei.com/...87876626530001 This seems a new platform for asking integration questions about HMS. I will try this.
Click to expand...
Click to collapse
Yep, welcome to experience it~

Push Kit Integration with Cocos

Introduction:
This article will demonstrate to Integrate Push kit in Cocos using Huawei HMS Core App Services Plugin. Huawei Push Kit is a messaging service. It establishes a messaging channel from the cloud to devices. By integrating Push Kit, you can send messages to your apps on users devices in real time. This helps to maintain closer ties with users and increases user awareness and engagement with your apps.
Note: Cocos is free but not open source.
Requirements:
1. Cocos Creator tool
2. Notepad++ for editing and writing script
3. HMS Device
4. Android Studio for Analyzing APK and Checking Log
Output:
Push Notification, Data Message.
Steps to Integrate:
1. Install and launch cocos creator.
2. Make sure to configure NDK Root and Android SDK Root in Cocos Creator, choose File> Settings>Select Native Develop.
3. Click in Cocos Dashboard, click New.
Create project name in Name section and click on hello-world and then Create and open.
Click on Project tab and then Build.
{
"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"
}
Enter Platform, Build Path and Package Name in build window.
Note: The package name should be same in app gallery connect.
In the same build popup, in the keystore section we can use default keystore (default location is /Users/<username>/.android/debug.keystore) and we can generate SHA key or we can create custom keystore and can generate SHA key.In Command line terminal execute the command below and get SHA key:
Code:
keytool -list -v -keystore keystorepath\keystorename.keystore
Steps to create custom key store file:
a) Uncheck use debug keystore
b) In keystore path section click on New button.
c) Enter all the details in New Keystore details and then click Save.
4. Step 1: Create a project in AppGallery using created SHA key
Step 2: Configure the signing certificate fingerprint
Choose 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: Download agconnect-services.json file and put in setting folder in cocos project.
Example:
Right click on Assets folder and then select Open in Explorer
Place agconnect-services.json file inside settings folder
5. Click Enable for Cocos SDKHub in Service tab.
Click on Association button and register project in Cocos Console
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.
Select Plugin Manage under Service tab.
Select Push option in Plugin Manage under Service tab.
Place mouse cursor over the "Configured" text so that "Edit" and "Delete" icons will be appeared. Click on edit icon.
Put public key(from AppGallery connect) in the "Payment Public key" field and select "en" option for "Support language" field and then click OK.
Script code for Notification and Data message:
onLoad: function () {
sdkhub.getPushPlugin().startPush();
sdkhub.getPushPlugin().setListener(this.onPushResult, this);
},
onPushResult: function (code, msg) {
console.log("on push result action.");
console.log("code: " + code);
console.log("massage: " + msg);
this.label.string=msg;
this.showToast(code, msg);
switch (code) {
case sdkhub.PushResultCode.kStartPushSucceed:
console.log("kStartPushSucceed", msg);
break;
}
},
6. Click on Build, Compile, Play under the Project tab to generate APK file.
Tips & Tricks:
Make sure to keep the same package name as kept in the Huawei AppGallery Connect project.
Conclusion:
To promote products and launch marketing activities, games, e-commerce apps, and utility apps can call Push Kit APIs to select target audiences by tag and push messages to them, attracting more users and improving the marketing activity conversion rate.
References:
> Note: this version of the documentation has been archived and is no longer maintained. Please move to the latest version. · Cocos Creator
docs.cocos.com

HMS Push kit Integration into Unity Game | Installation and Example

Introduction
In this article, we will learn how to add Push kit into our Unity Game. Push notifications are those notifications that we receive on our cell phone, smartwatch or computer with a message informing us about an event or encouraging us to take a certain action. While we usually take more time to read an email, we do the opposite with notifications: we respond to the stimulus by seeing them quickly (and it is that many times, to see a push it is not even necessary to unlock our screen). Thus, it is possible to take advantage of push notifications as a direct communication channel with our users, and they are a fundamental tool when it comes to generating engagement and building a lasting relationship.
Implementation Steps
1. Creation of our App in App Gallery Connect
2. Evil Mind plugin Integration
3. Configuration in Unity
4. Creation of the scene
5. Coding
6. Configuration for project execution
7. Final result
App Gallery Connect Configuration
Creating a new App in the App Gallery connect console is a fairly simple procedure but requires paying attention to certain important aspects.
{
"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"
}
Once inside the console we must create a project and to this project we must add an App.
When creating our App we will find the following form. It is important to take into account that the category of the App must be Game.
Once the App is created, it will be necessary for us to activate the Account Kit in our APIs, we can also activate the Game service if we wish.
HUAWEI Push Kit establishes a messaging channel from the cloud to devices. By integrating Push Kit, you can send messages to your apps on users' devices in real time.
Once this configuration is completed, it will be necessary to add the SHA-256 fingerprint, for this we can use the keytool command, but for this we must first create a keystore and for this we can use Unity.
Remember that we must change the platform we are on since normally Unity will always assign us as a PC platform.
Once the keystore is created we must open the console, go to the path where the keystore is located and execute the following code. Remember that to use this command you must have the Java JDK installed.
Once inside the route
Keytool -list -v -keystore yournamekey.keystore
This will give us all the information in our keystore, we obtain the SHA256 and add it to the App.
Unity Evil Mind Plugin configuration
We have concluded the creation of the App, the project and now we know how we can create a keystore and obtain the sha in Unity.
In case you have not done it now we must create our project in Unity once the project is created we must obtain the project package which we will use to connect our project with the AGC SDK. first of all let's go download the Evil Mind plugin.
GitHub - EvilMindDevs/hms-unity-plugin
Contribute to EvilMindDevs/hms-unity-plugin development by creating an account on GitHub.
github.com
In the link you can find the package to import it to Unity, to import it we must follow the following steps.
Download the .unity package and then import it into Unity using the package importer.
Once imported, you will have the Huawei option in the toolbar, we click on the option and add the data from our App.
Once we have imported the plugin we will have to add the necessary data from our App Gallery App and place it within the
required fields of the Unity plugin. Well, now we have our App Gallery App connected to the Unity project.
Now we can add the Push Notifications prefab to our scene remember that to do this we must create a new scene,
for this example we can use the eschena that the plugin provides.
For more, you can check https://forums.developer.huawei.com/forumPortal/en/topic/0202457956096970035
Why thus p40 pro giveaway date is extending every time?
YUAman said:
Why thus p40 pro giveaway date is extending every time?
Click to expand...
Click to collapse
Hi, you mean? I can not understand.

Categories

Resources