Skip to content

Commit

Permalink
[notification-hubs] Adding Support for FCM V1 (#28573)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR

- @azure/notification-hubs

### Issues associated with this PR

N/A

### Describe the problem that is addressed by this PR

Adds support for [Firebase Messaging
V1](https://firebase.google.com/docs/cloud-messaging) following the PR
from the Azure Notification Hubs Team
Azure/azure-notificationhubs-dotnet#302

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_

Yes

### Provide a list of related PRs _(if any)_

Azure/azure-notificationhubs-dotnet#302

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [x] Added a changelog (if necessary)
  • Loading branch information
mpodwysocki authored Feb 14, 2024
1 parent b82222b commit 262c96e
Show file tree
Hide file tree
Showing 43 changed files with 1,330 additions and 155 deletions.
6 changes: 6 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@
"spreadsheetml",
"presentationml"
]
},
{
"filename": "sdk/notificationhubs/notification-hubs/review/notification-hubs.api.md",
"words": [
"fcmv"
]
}
]
}
11 changes: 5 additions & 6 deletions sdk/notificationhubs/notification-hubs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Release History

## 1.0.4 (Unreleased)
## 1.1.0 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Added Support for [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging) V1 API with the following:
- `FcmV1RegistrationDescription` and `FcmV1TemplateRegistrationDescription` for registrations with associated factory methods.
- `FcmV1Installation` for installation operations and associated factory methods.
- `FcmV1Notification` for notification send support and associated factory methods.

## 1.0.3 (2023-11-13)

Expand Down
4 changes: 2 additions & 2 deletions sdk/notificationhubs/notification-hubs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Azure Notification Hubs SDK for JavaScript

Azure Notification Hubs provide a scaled-out push engine that enables you to send notifications to any platform (Apple, Amazon Kindle, Android, Baidu, Xiaomi, Web, Windows, etc.) from any back-end (cloud or on-premises). Notification Hubs works well for both enterprise and consumer scenarios. Here are a few example scenarios:
Azure Notification Hubs provide a scaled-out push engine that enables you to send notifications to any platform (Apple, Amazon Kindle, Firebase, Baidu, Xiaomi, Web, Windows, etc.) from any back-end (cloud or on-premises). Notification Hubs works well for both enterprise and consumer scenarios. Here are a few example scenarios:

- Send breaking news notifications to millions with low latency.
- Send location-based coupons to interested user segments.
Expand Down Expand Up @@ -735,7 +735,7 @@ This module's tests are a mixture of live and unit tests, which require you to h
`NOTIFICATIONHUBS_CONNECTION_STRING=connection string for your Notification Hubs instance`
`NOTIFICATION_HUB_NAME=Notification Hub name`
4. `cd sdk\notificationhubs\notification-hubs`
5. `npm run test`.
5. `rushx test`.

View our [tests](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/notificationhubs/notification-hubs/test)
folder for more details.
Expand Down
24 changes: 20 additions & 4 deletions sdk/notificationhubs/notification-hubs/karma.conf.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
require("dotenv").config();
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");

process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();

module.exports = function (config) {
config.set({
Expand Down Expand Up @@ -46,8 +49,14 @@ module.exports = function (config) {
// inject following environment values into browser testing with window.__env__
// environment values MUST be exported or set with same console running "karma start"
// https://www.npmjs.com/package/karma-env-preprocessor
envPreprocessor: ["TEST_MODE", "NOTIFICATIONHUBS_CONNECTION_STRING", "NOTIFICATION_HUB_NAME"],

envPreprocessor: [
"TEST_MODE",
"WIDGET_SERVICE_ENDPOINT",
"AZURE_CLIENT_ID",
"AZURE_CLIENT_SECRET",
"AZURE_TENANT_ID",
"RECORDINGS_RELATIVE_PATH",
],
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
Expand Down Expand Up @@ -90,12 +99,19 @@ module.exports = function (config) {
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// 'ChromeHeadless', 'Chrome', 'Firefox', 'Edge', 'IE'
browsers: ["ChromeHeadless"],
browsers: ['ChromeHeadlessNoSandbox'],

customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', "--disable-web-security"]
}
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: 1,
Expand Down
1 change: 1 addition & 0 deletions sdk/notificationhubs/notification-hubs/migrationguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ We have a variety of new features in the `@azure/notification-hubs` library such
- Support for additional Push Notification Providers such as
- Amazon Device Message (ADM)
- Baidu Cloud Push
- Firebase Cloud Messaging (FCM) V1
- Xiaomi Message Service
- Web Push
- Scheduled Notifications for Standard SKU and higher.
Expand Down
31 changes: 15 additions & 16 deletions sdk/notificationhubs/notification-hubs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/notification-hubs",
"version": "1.0.4",
"version": "1.1.0",
"description": "Azure Notification Hubs SDK for JavaScript",
"sdk-type": "client",
"main": "dist/index.cjs",
Expand Down Expand Up @@ -42,8 +42,8 @@
"build:samples": "echo Obsolete",
"build:test": "npm run bundle",
"build": "npm run build:test && api-extractor run --local",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf -G dist dist-* temp types *.tgz *.log",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"samples-dev/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
Expand Down Expand Up @@ -90,15 +90,15 @@
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure/test-utils": "^1.0.0",
"@microsoft/api-extractor": "^7.38.2",
"@microsoft/api-extractor": "^7.40.1",
"@types/chai": "^4.3.1",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"c8": "^8.0.0",
"chai": "^4.3.10",
"dotenv": "^16.3.1",
"eslint": "^8.53.0",
"esm": "^3.2.18",
"dotenv": "^16.4.4",
"eslint": "^8.56.0",
"esm": "^3.2.25",
"karma": "^6.4.2",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage": "^2.2.0",
Expand All @@ -113,21 +113,20 @@
"mocha": "^10.0.0",
"puppeteer": "^22.0.0",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"typescript": "~5.3.3",
"util": "^0.12.4"
"ts-node": "^10.9.2",
"typescript": "~5.3.3"
},
"dependencies": {
"@azure/core-auth": "^1.5.0",
"@azure/abort-controller": "^1.1.0",
"@azure/core-lro": "^2.5.4",
"@azure/core-auth": "^1.6.0",
"@azure/abort-controller": "^2.0.0",
"@azure/core-lro": "^2.6.0",
"@azure/core-paging": "^1.5.0",
"@azure/core-rest-pipeline": "^1.12.2",
"@azure/core-rest-pipeline": "^1.14.0",
"@azure/core-tracing": "^1.0.1",
"@azure/core-util": "^1.6.1",
"@azure/core-util": "^1.7.0",
"@azure/core-xml": "^1.3.4",
"@azure/logger": "^1.0.4",
"@azure-rest/core-client": "^1.1.4",
"@azure-rest/core-client": "^1.2.0",
"tslib": "^2.6.2"
}
}
Loading

0 comments on commit 262c96e

Please sign in to comment.