Skip to content

Commit

Permalink
Accept all options when sending a silent notification
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBarba committed Feb 6, 2023
1 parent 43f49b6 commit 857f9fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

---

## [11.1.0](https://github.com/AndrewBarba/apns2/releases/tag/11.1.0)

1. Accept all options when sending a silent notification

## [11.0.1](https://github.com/AndrewBarba/apns2/releases/tag/11.0.1)

1. Add back support for Node.js 16.x
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apns2",
"version": "11.0.1",
"version": "11.1.0",
"description": "Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens.",
"author": "Andrew Barba <[email protected]>",
"main": "dist/index.js",
Expand Down
5 changes: 4 additions & 1 deletion src/notifications/silent-notification.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Notification, NotificationOptions, PushType, Priority } from './notification'

export class SilentNotification extends Notification {
constructor(deviceToken: string, options: Pick<NotificationOptions, 'data'> = {}) {
constructor(
deviceToken: string,
options: Omit<NotificationOptions, 'type' | 'alert' | 'priority' | 'contentAvailable'> = {}
) {
super(deviceToken, {
contentAvailable: true,
type: PushType.background,
Expand Down

0 comments on commit 857f9fc

Please sign in to comment.