diff --git a/cordova-plugin-hms-push/OpenSourceSoftwareNotice.html b/cordova-plugin-hms-push/OpenSourceSoftwareNotice.html index bc14e29d..8e907ced 100644 --- a/cordova-plugin-hms-push/OpenSourceSoftwareNotice.html +++ b/cordova-plugin-hms-push/OpenSourceSoftwareNotice.html @@ -14,7 +14,7 @@

Copyright Notice and License Texts

-

Software: com.facebook.fresco:fresco 2.6.0

+

Software: com.facebook.fresco:fresco 3.1.3

Copyright notice:

diff --git a/cordova-plugin-hms-push/README.md b/cordova-plugin-hms-push/README.md index df121d8c..37bb3fe1 100644 --- a/cordova-plugin-hms-push/README.md +++ b/cordova-plugin-hms-push/README.md @@ -1,12 +1,17 @@ -# Cordova HMS Push +

+

Cordova HMS Push

+

-Cordova Push Kit is a messaging service provided for you. It establishes a messaging channel from -the cloud to devices. By integrating Cordova Push Kit, you can send messages to your apps on users' -devices in real time. This helps you maintain closer ties with users and increases user awareness of -and engagement with your apps. -This plugin enables communication between Huawei Push SDK and Cordova platform. It exposes all -functionality provided by Huawei Push SDK. +

+ downloads + NPM version + License +

+ +---- + +This plugin enables communication between Huawei Ads SDK and Cordova platform. It exposes all functionality provided by Huawei Ads SDK. [> Learn More](https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/introduction-0000001050136388?ha_source=hms1) diff --git a/cordova-plugin-hms-push/example/cordova/README.md b/cordova-plugin-hms-push/example/cordova/README.md index 5e2154e8..7aa8ee09 100644 --- a/cordova-plugin-hms-push/example/cordova/README.md +++ b/cordova-plugin-hms-push/example/cordova/README.md @@ -19,7 +19,45 @@ This demo application demonstrates the usage of HMS Push Cordova Plugin. ## 2. Installation Guide -### 2.1. Cordova +Before you get started, you must register as a HUAWEI Developer and complete identity verification +on the [HUAWEI Developer](https://developer.huawei.com/consumer/en/?ha_source=hms1) website. For +details, please refer +to [Register a HUAWEI ID](https://developer.huawei.com/consumer/en/doc/10104?ha_source=hms1). + +### 2.1. Creating a Project in AppGallery Connect + +Creating an app in AppGallery Connect is required in order to communicate with the Huawei services. +To create an app, perform the following steps: + +1. Sign in + to [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html?ha_source=hms1) + and select **My projects**. +2. Select your project from the project list or create a new one by clicking the **Add Project** + button. +3. Go to **Project Setting** > **General information**, and click **Add app**. + - If an app exists in the project and you need to add a new one, expand the app selection area + on the top of the page and click **Add app**. +4. On the **Add app** page, enter the app information, and click **OK**. + +### 2.2. Configuring the Signing Certificate Fingerprint and Obtaining agconnect-services.json + +A signing certificate fingerprint is used to verify the authenticity of an app when it attempts to +access an HMS Core (APK) through the HMS SDK. Before using the HMS Core (APK), you must locally +generate a signing certificate fingerprint and configure it in the **AppGallery Connect**. You can +refer to 3rd and 4th steps +of [Generating a Signing Certificate](https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html#2?ha_source=hms1) +Codelab tutorial for the certificate generation. Perform the following steps after you have +generated the certificate. + +1. Sign in + to [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html?ha_source=hms1) + and select your project from **My Projects**. Then go to **Project Setting** > **General + information**. In the **App information** field, click the icon next to SHA-256 certificate + fingerprint, and enter the obtained **SHA-256 certificate fingerprint**. +2. After completing the configuration, click **OK** to save the changes. (Check mark icon) +3. In the same page, click **agconnect-services.json** button to download the configuration file. + +### 2.3. Cordova 1. Install Cordova CLI. @@ -91,6 +129,26 @@ This demo application demonstrates the usage of HMS Push Cordova Plugin. ## 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 IAP plugin's ProGuard rules need to be added to your project. These rules are as follows: + +```text +-ignorewarnings +-keepattributes *Annotation* +-keepattributes Exceptions +-keepattributes InnerClasses +-keepattributes Signature +-keep class com.huawei.hianalytics.**{*;} +-keep class com.huawei.updatesdk.**{*;} +-keep class com.huawei.hms.**{*;} +-repackageclasses +``` + --- ## 4. Questions or Issues diff --git a/cordova-plugin-hms-push/example/cordova/config.xml b/cordova-plugin-hms-push/example/cordova/config.xml index 0af51515..3ff7d245 100644 --- a/cordova-plugin-hms-push/example/cordova/config.xml +++ b/cordova-plugin-hms-push/example/cordova/config.xml @@ -1,5 +1,5 @@ - + CordovaHMSPushDemo diff --git a/cordova-plugin-hms-push/example/cordova/package.json b/cordova-plugin-hms-push/example/cordova/package.json index 38e73925..0685d17c 100644 --- a/cordova-plugin-hms-push/example/cordova/package.json +++ b/cordova-plugin-hms-push/example/cordova/package.json @@ -1,7 +1,7 @@ { "name": "CordovaHMSPushDemo", "displayName": "CordovaHMSPushDemo", - "version": "6.12.0-300", + "version": "6.12.0-302", "description": "A demo application which shows the usage of HMS Push SDK", "main": "index.js", "scripts": { diff --git a/cordova-plugin-hms-push/example/ionic/README.md b/cordova-plugin-hms-push/example/ionic/README.md index c072c9ab..7562f508 100644 --- a/cordova-plugin-hms-push/example/ionic/README.md +++ b/cordova-plugin-hms-push/example/ionic/README.md @@ -1,4 +1,4 @@ -# HMS Push Cordova Demo +# HMS Push Ionic Demo ## Contents @@ -21,21 +21,61 @@ This demo application demonstrates the usage of HMS Push Cordova Plugin. ## 2. Installation Guide -### 2.1. Ionic +Before you get started, you must register as a HUAWEI Developer and complete identity verification +on the [HUAWEI Developer](https://developer.huawei.com/consumer/en/?ha_source=hms1) website. For +details, please refer +to [Register a HUAWEI ID](https://developer.huawei.com/consumer/en/doc/10104?ha_source=hms1). -1. Install Ionic CLI. +### 2.1. Creating a Project in AppGallery Connect + +Creating an app in AppGallery Connect is required in order to communicate with the Huawei services. +To create an app, perform the following steps: + +1. Sign in + to [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html?ha_source=hms1) + and select **My projects**. +2. Select your project from the project list or create a new one by clicking the **Add Project** + button. +3. Go to **Project Setting** > **General information**, and click **Add app**. + - If an app exists in the project and you need to add a new one, expand the app selection area + on the top of the page and click **Add app**. +4. On the **Add app** page, enter the app information, and click **OK**. + +### 2.2. Configuring the Signing Certificate Fingerprint and Obtaining agconnect-services.json + +A signing certificate fingerprint is used to verify the authenticity of an app when it attempts to +access an HMS Core (APK) through the HMS SDK. Before using the HMS Core (APK), you must locally +generate a signing certificate fingerprint and configure it in the **AppGallery Connect**. You can +refer to 3rd and 4th steps +of [Generating a Signing Certificate](https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html#2?ha_source=hms1) +Codelab tutorial for the certificate generation. Perform the following steps after you have +generated the certificate. + +1. Sign in + to [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html?ha_source=hms1) + and select your project from **My Projects**. Then go to **Project Setting** > **General + information**. In the **App information** field, click the icon next to SHA-256 certificate + fingerprint, and enter the obtained **SHA-256 certificate fingerprint**. +2. After completing the configuration, click **OK** to save the changes. (Check mark icon) +3. In the same page, click **agconnect-services.json** button to download the configuration file. + +### 2.3. Ionic + +1. Install Ionic CLI and other required tools if haven't done before. ```bash - npm install -g @ionic/cli + npm install -g @ionic/cli cordova-res native-run ``` -2. Create a new Ionic project or use existing Ionic project. +2. Open the demo project's root directory. + +3. Install project dependencies. -- To create a new Ionic project, you can use **`ionic start