Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

HMS Push Cordova Demo

Contents


1. Introduction

This demo application demonstrates the usage of HMS Push Cordova Plugin.


2. Installation Guide

2.1. Cordova

  1. Install Cordova CLI.

    npm install -g cordova
  2. Open the demo project root folder.

  3. Update the widget id property which is specified in the config.xml file.

  4. Add the Android platform to the project.

    cordova platform add android
  5. Install HMS Push Cordova Plugin to the project. You can either install the plugin through npm or by downloading from HMS Core Plugin page.

    a. Run the following command in the root directory of your project to install it through npm.

    cordova plugin add @hmscore/cordova-plugin-hms-push

    b. Or download the plugin from Plugin > Push Kit > Cordova Plugin page and run the following command in the root directory of your project to install it manually.

    cordova plugin add <hms_cordova_push_plugin_path>
  6. Add keystore(.jks) and build.json files to your project's root directory.

    • You can refer to 3rd and 4th steps of Generating a Signing Certificate Codelab tutorial page for generating keystore file.
    • Fill build.json file according to your keystore information. For example:
    {
      "android": {
        "debug": {
          "keystore": "<keystore_file>.jks",
          "storePassword": "<keystore_password>",
          "alias": "<key_alias>",
          "password": "<key_password>"
        },
        "release": {
          "keystore": "<keystore_file>.jks",
          "storePassword": "<keystore_password>",
          "alias": "<key_alias>",
          "password": "<key_password>"
        }
      }
    }
  7. Run the application.

    cordova run android --device

3. Configuration and Description


4. Questions or Issues

If you have questions about how to use HMS samples, try the following options:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with huawei-mobile-services.
  • GitHub is the official repository for these plugins, You can open an issue or submit your ideas.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.
  • Huawei Developer Docs is place to official documentation for all HMS Core Kits, you can find detailed documentations in there.

If you run into a bug in our samples, please submit an issue to the GitHub repository.


5. Licensing and Terms

HMS Push Cordova Plugin is licensed under the Apache 2.0 license.