Skip to content

Commit

Permalink
UPDATE cordova-plugin-hms-push 6.12.0-302
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkulbeng authored Aug 26, 2024
1 parent 527015e commit 8c51815
Show file tree
Hide file tree
Showing 35 changed files with 1,365 additions and 2,285 deletions.
2 changes: 1 addition & 1 deletion cordova-plugin-hms-push/OpenSourceSoftwareNotice.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="color:#000000"><strong><span style="font-size:16pt"><span style="font-family:Arial,sans-serif">Copyright Notice and License Texts</span></span></strong></span></span></span></p>

<h1 style="text-align:start"><span style="font-size:22pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><strong><span style="color:#000000"><span style="font-size:10.5pt"><span style="font-family:Arial,sans-serif">Software: com.facebook.fresco:fresco 2.6.0</span></span></span></strong></span></span></h1>
<h1 style="text-align:start"><span style="font-size:22pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><strong><span style="color:#000000"><span style="font-size:10.5pt"><span style="font-family:Arial,sans-serif">Software: com.facebook.fresco:fresco 3.1.3</span></span></span></strong></span></span></h1>

<p style="text-align:start"><span style="font-size:10.5pt"><span style="font-family:&quot;Times New Roman&quot;,serif"><span style="color:#000000"><strong><span style="font-family:Arial,sans-serif">Copyright notice:</span></strong></span></span></span></p>

Expand Down
19 changes: 12 additions & 7 deletions cordova-plugin-hms-push/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Cordova HMS Push
<p align="center">
<h1 align="center">Cordova HMS Push</h1>
</p>

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.
<p align="center">
<a href="https://www.npmjs.com/package/@hmscore/cordova-plugin-hms-push"><img src="https://img.shields.io/npm/dm/@hmscore/cordova-plugin-hms-push?color=%23007EC6&style=for-the-badge" alt="downloads"></a>
<a href="https://www.npmjs.com/package/@hmscore/cordova-plugin-hms-push"><img src="https://img.shields.io/npm/v/@hmscore/cordova-plugin-hms-push?color=%23ed2a1c&style=for-the-badge" alt="NPM version"></a>
<a href="./LICENSE"><img src="https://img.shields.io/npm/l/@hmscore/cordova-plugin-hms-push.svg?color=%3bcc62&style=for-the-badge" alt="License"></a>
</p>

----

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)

Expand Down
60 changes: 59 additions & 1 deletion cordova-plugin-hms-push/example/cordova/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cordova-plugin-hms-push/example/cordova/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<widget id="<PACKAGE_NAME>" version="6.12.0.300" xmlns="http://www.w3.org/ns/widgets">
<widget id="<PACKAGE_NAME>" version="6.12.0.302" xmlns="http://www.w3.org/ns/widgets">
<name>
CordovaHMSPushDemo
</name>
Expand Down
2 changes: 1 addition & 1 deletion cordova-plugin-hms-push/example/cordova/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
66 changes: 53 additions & 13 deletions cordova-plugin-hms-push/example/ionic/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HMS Push Cordova Demo
# HMS Push Ionic Demo

## Contents

Expand All @@ -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 <name> <template> [options]`** command.
For more details please
follow [ionic start - Ionic Documentation](https://ionicframework.com/docs/cli/commands/start).
```bash
npm install
```

#### 2.1.1. With Cordova Runtime
#### 2.3.1. Ionic with Cordova Runtime

1. Enable the **Cordova integration** if haven't done before.

Expand Down Expand Up @@ -72,7 +112,7 @@ This demo application demonstrates the usage of HMS Push Cordova Plugin.
5. If you want to enable Ionic Native support then run the following command.

```bash
npm install @ionic-native/core @hmscore/ionic-native-hms-push
npm install @awesome-cordova-plugins/core @hmscore/ionic-native-hms-push
```

6. Copy **`agconnect-services.json`** file to **`<project_root>/android/app`** directory.
Expand Down Expand Up @@ -110,7 +150,7 @@ This demo application demonstrates the usage of HMS Push Cordova Plugin.
ionic cordova run android --device
```

#### 2.1.2. With Capacitor Runtime
#### 2.3.2. With Capacitor Runtime

1. Enable the **Capacitor integration** if haven't done before.

Expand Down Expand Up @@ -142,7 +182,7 @@ This demo application demonstrates the usage of HMS Push Cordova Plugin.
4. If you want to enable Ionic Native support then run the following command.

```bash
npm install @ionic-native/core @hmscore/ionic-native-hms-push
npm install @awesome-cordova-plugins/core @hmscore/ionic-native-hms-push
```

5. Build Ionic app to generate resource files.
Expand Down Expand Up @@ -219,7 +259,7 @@ This demo application demonstrates the usage of HMS Push Cordova Plugin.
/*
<Other dependencies>
*/
classpath 'com.huawei.agconnect:agcp:1.9.1.300'
classpath 'com.huawei.agconnect:agcp:1.9.1.301'
}
}
Expand Down
12 changes: 6 additions & 6 deletions cordova-plugin-hms-push/example/ionic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HMSPushDemo",
"version": "6.12.0-300",
"version": "6.12.0-302",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -17,12 +17,12 @@
"@angular/platform-browser": "15.0.0",
"@angular/platform-browser-dynamic": "15.0.0",
"@angular/router": "15.0.0",
"@ionic-native/core": "^5.36.0",
"@ionic-native/splash-screen": "5.36.0",
"@ionic-native/status-bar": "5.36.0",
"@ionic/angular": "6.1.9",
"@awesome-cordova-plugins/core": "6.4.0",
"@awesome-cordova-plugins/splash-screen": "6.4.0",
"@awesome-cordova-plugins/status-bar": "6.4.0",
"@ionic/angular": "7.6.0",
"@ionic/cordova-builders": "^9.0.0",
"rxjs": "6.6.0",
"rxjs": "7.8.0",
"tslib": "2.3.0",
"zone.js": "0.11.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { TestBed, async } from "@angular/core/testing";

import { Platform } from "@ionic/angular";
import { SplashScreen } from "@ionic-native/splash-screen/ngx";
import { StatusBar } from "@ionic-native/status-bar/ngx";
import { SplashScreen } from "@awesome-cordova-plugins/splash-screen/ngx";
import { StatusBar } from "@awesome-cordova-plugins/status-bar/ngx";

import { AppComponent } from "./app.component";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import { Component } from "@angular/core";

import { Platform } from "@ionic/angular";
import { SplashScreen } from "@ionic-native/splash-screen/ngx";
import { StatusBar } from "@ionic-native/status-bar/ngx";
import { SplashScreen } from "@awesome-cordova-plugins/splash-screen/ngx";
import { StatusBar } from "@awesome-cordova-plugins/status-bar/ngx";

@Component({
selector: "app-root",
Expand Down
4 changes: 2 additions & 2 deletions cordova-plugin-hms-push/example/ionic/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { BrowserModule } from "@angular/platform-browser";
import { RouteReuseStrategy } from "@angular/router";

import { IonicModule, IonicRouteStrategy } from "@ionic/angular";
import { SplashScreen } from "@ionic-native/splash-screen/ngx";
import { StatusBar } from "@ionic-native/status-bar/ngx";
import { SplashScreen } from "@awesome-cordova-plugins/splash-screen/ngx";
import { StatusBar } from "@awesome-cordova-plugins/status-bar/ngx";

import { AppComponent } from "./app.component";
import { AppRoutingModule } from "./app-routing.module";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ export class HomePage {
this.hmsPushEvent.onPushMessageSentError((result) => {
this.addLog("ON_PUSH_MESSAGE_SENT_ERROR", JSON.stringify(result));
});

this.hmsPushEvent.onMultiSenderTokenReceivedEvent((result) => {
this.addLog("ON_MULTI_SENDER_TOKEN_RECEIVED_EVENT", JSON.stringify(result));
});

this.hmsPushEvent.onMultiSenderTokenErrorEvent((result) => {
this.addLog("ON_MULTI_SENDER_TOKEN_ERROR_EVENT", JSON.stringify(result));
});
}

openCustomIntent() {
Expand Down
2 changes: 1 addition & 1 deletion cordova-plugin-hms-push/hooks/after_plugin_install.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function (context) {

function addAGConnectDependency(lines) {
var AG_CONNECT_DEPENDENCY =
"classpath 'com.huawei.agconnect:agcp:1.9.1.300' " + COMMENT;
"classpath 'com.huawei.agconnect:agcp:1.9.1.301' " + COMMENT;
var pattern =
/(\s*)classpath(\s+)[\',\"]com.android.tools.build:gradle.*[^\]\n]/m;
var index;
Expand Down
34 changes: 27 additions & 7 deletions cordova-plugin-hms-push/ionic-native/dist/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Ionic Native HMS Push
<p align="center">
<h1 align="center">Ionic Native HMS Push</h1>
</p>


<p align="center">
<a href="https://www.npmjs.com/package/@hmscore/ionic-native-hms-push"><img src="https://img.shields.io/npm/dm/@hmscore/ionic-native-hms-push?color=%23007EC6&style=for-the-badge" alt="downloads"></a>
<a href="https://www.npmjs.com/package/@hmscore/ionic-native-hms-push"><img src="https://img.shields.io/npm/v/@hmscore/ionic-native-hms-push?color=%23ed2a1c&style=for-the-badge" alt="NPM version"></a>
<a href="./LICENSE"><img src="https://img.shields.io/npm/l/@hmscore/ionic-native-hms-push.svg?color=%3bcc62&style=for-the-badge" alt="License"></a>
</p>

----

## 1. About

Expand All @@ -16,7 +27,7 @@ $ ionic cordova plugin add @hmscore/cordova-plugin-hms-push
```

```bash
$ npm install @ionic-native/core @hmscore/ionic-native-hms-push
$ npm install @awesome-cordova-plugins/core @hmscore/ionic-native-hms-push
```

### 2.2 With Capacitor Runtime
Expand All @@ -26,19 +37,28 @@ $ npm install @hmscore/cordova-plugin-hms-push
```

```bash
$ npm install @ionic-native/core @hmscore/ionic-native-hms-push
$ npm install @awesome-cordova-plugins/core @hmscore/ionic-native-hms-push
```

---

## 3. Developer Documents
## 3. Usage Documentation

- [GitHub repository](https://github.com/HMS-Core/hms-cordova-plugin)

- [API reference and sample codes](https://github.com/HMS-Core/hms-cordova-plugin/blob/master/cordova-plugin-hms-push/README.md#3-api-reference)

---

## 4. Sample Project

You can find the development guide, API reference, and sample project on
the [HMS Core](https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1) page.
You can find the sample projects
on [HMS Core > Samples > In-App Purchases](https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1)
page.

---

## 4. Questions or Issues
## 5. Questions or Issues

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

Expand Down
Loading

0 comments on commit 8c51815

Please sign in to comment.