Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

HMS Contact Shield Cordova Demo

Contents


1. Introduction

This demo application demonstrates the usage of the HMS Contact Shield Kit Cordova plugin.


2. Installation Guide

  1. Install Cordova CLI if haven't done before.

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

  3. Add the Android platform to the project if haven't done before.

    cordova platform add android
  4. Install HMS Contact Shield plugin to the project.

    cordova plugin add @hmscore/cordova-plugin-hms-contactshield
  5. Run the app.

    cordova run android --device

3. Configuration and Description

Configuring Obfuscation Scripts

Before building the APK, configure the obfuscation configuration file to prevent the HMS Core SDK from being obfuscated.

NOTE: This step is required only if you want to minify and obfuscate your app. By default obfuscation is disabled in Cordova and Ionic apps.

The obfuscation is done by ProGuard. By default, in Cordova and Ionic apps ProGuard is disabled. Even though ProGuard is not available, ProGuard support can be added through 3rd party ProGuard plugins. If ProGuard is enabled in your project, the Huawei Cordova Contact Shield plugin's ProGuard rules need to be added to your project. These rules are as follows:

-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
-keep class com.huawei.hms.contactshield.**{*;}
-keep interface com.huawei.hms.contactshield.**{*;}
-keep class com.huawei.openalliance.ad.**{*;}
-repackageclasses

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

Huawei Contact Shield Kit Cordova Plugin is licensed under the Apache 2.0 license.