-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38e53fa
commit e6134af
Showing
4 changed files
with
76 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { EventEmitter } from "events" | ||
|
||
export class APNS extends EventEmitter { | ||
constructor(options: APNSOptions) | ||
send(notification: Notification): Promise<Notification> | ||
send(notifications: Notification[]): Promise<Notification[]> | ||
} | ||
|
||
export class Notification { | ||
constructor(deviceToken: string, options?: NotificationOptions) | ||
static readonly priority: NotificationPriority | ||
readonly deviceToken: string | ||
readonly priority: number | ||
readonly expiration: number | ||
readonly topic: string | ||
readonly collapseId: string | ||
} | ||
|
||
export class BasicNotification extends Notification { | ||
constructor(deviceToken: string, message: string, options?: NotificationOptions) | ||
} | ||
|
||
export class SilentNotification extends Notification { | ||
constructor(deviceToken: string, options?: NotificationOptions) | ||
} | ||
|
||
export const Errors: { | ||
badCertificate: string | ||
badCertificateEnvironment: string | ||
badCollapseId: string | ||
badDeviceToken: string | ||
badExpirationDate: string | ||
badMessageId: string | ||
badPath: string | ||
badPriority: string | ||
badTopic: string | ||
deviceTokenNotForTopic: string | ||
duplicateHeaders: string | ||
error: string | ||
expiredProviderToken: string | ||
forbidden: string | ||
idleTimeout: string | ||
internalServerError: string | ||
invalidProviderToken: string | ||
invalidSigningKey: string | ||
methodNotAllowed: string | ||
missingDeviceToken: string | ||
missingTopic: string | ||
payloadEmpty: string | ||
payloadTooLarge: string | ||
serviceUnavailable: string | ||
shutdown: string | ||
tooManyRequests: string | ||
topicDisallowed: string | ||
unknownError: string | ||
unregistered: string | ||
} | ||
|
||
declare interface APNSOptions { | ||
team: string | ||
keyId: string | ||
signingKey: string | ||
defaultTopic?: string | ||
host?: string | ||
port?: number | ||
} | ||
|
||
declare interface NotificationPriority { | ||
immediate: number | ||
throttled: number | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "apns2", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"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": "lib/apns.js", | ||
|