Teach you how to pack H5 games into fast games

H5 games can be quickly packaged into fast games through the web components of the fast app. After the fast games are packaged and put on the shelves, as long as the url of the original H5 game does not change, the fast games do not need to be updated and the maintenance workload is small.

Using the fast application IDE, the operation of packaging fast games is very simple.

  1. Visit the official website to install the development tools and install the Kuaiapp IDE on the PC.

  2. Select "File> New Project> New QuickApp Project" from the menu, create a project, and select "HTML5 Game" as the template.

  • App Name: The name of the application, corresponding to the name field in the manifest.json file.

  • Package Name: The package name of the application, corresponding to the package field in the manifest.json file.
    Insert picture description here

  1. Click "OK" to create a quick game project.

  2. Configure the manifest.json file.

  • package: The package name of Quick Game. Once it is on the shelves, this package name cannot be modified, otherwise the version cannot be upgraded.

  • name: The name of the fast game.

  • versionName: The name of the fast game version, which requires +1 when upgrading, such as 2.0.0.

  • versionCode: The version number of the fast game, which requires +1 when upgrading, such as 2.

  • icon: The logo icon of Kuai game, used when creating desktop icon, logo.png needs to be replaced with the icon of H5 game.

  • minPlatformVersion: The minimum supported platform version number. The principle is the same as Android API Level. In order to avoid incompatibility caused by the low version after going online, it is recommended to set the highest version, such as 1070.

{
    
    
"package": "com.huawei.quickgamedemo",
    "name": "QuickGameDemo",
    "versionName": "1.0.0",
    "versionCode": 1,
    "icon": "/Common/logo.png",
    "minPlatformVersion": 1070,
    "features": [
        {
    
    
            "name": "system.prompt"
        },
        {
    
    
            "name": "service.pay"
        },
        {
    
    
            "name": "service.account"
        }
    ],
    "permissions": [
        {
    
    
            "origin": "*"
        }
    ],
    "config": {
    
    },
    "router": {
    
    
        "entry": "Hello",
        "pages": {
    
    
            "Hello": {
    
    
                "component": "hello"
            }
        }
    },
    "display": {
    
    
        "titleBar": false,
        "fullScreen": true
    }
}
  1. Edit the .ux file that loads the H5 game. The project project takes the hello.ux file as an example.
  • src: Configure the url of the H5 game.

  • fullscreendirection: Set the direction of the game. landscape: horizontal screen, portrait: vertical screen.

  • jumppolicy: The strategy of link jump in the game. If there are advertisements in the game, it is recommended to set it to browser and set multiwindow to true.

  • allowthirdpartycookies: Identifies whether to support the delivery of cross-domain cookies, the default is false. If the web page needs to access cookies across domains, such as logging in with a third-party account, you must set this field to true.
    Insert picture description here

Insert picture description here

  • trustedurl: If the game login successfully loaded page is different from the game open page, please set it.
  1. Select "Tools> Certificate" from the menu to check whether an official certificate has been generated. If it is not generated, click "Create" to generate the certificate, and the certificate is saved in the sign> release directory. Be sure to keep the certificate, once it is lost, it cannot be retrieved.
    Insert picture description here

  2. Select "Build> Run Release" from the menu to package the official fast game rpk package, and store the generated rpk package in the dist directory of the project.
    Note: The fast game submitted to the app market must be an official package packaged in this way.

Finally, the directory structure of the entire fast game project is as follows:
Insert picture description here

  At this point, you have successfully packaged the H5 fast game into a fast game. If you want to integrate more functions in the fast game and test and run your fast game, please refer to the official documentation of developing a fast game (H5 version).


Original link: https: //developer.huawei.com/consumer/cn/forum/topicview tid = 0203363609009640070 & fid = 18?
Author: Drum Chao

Guess you like

Origin blog.csdn.net/weixin_44708240/article/details/108880700