### Install and Run Example Server Source: https://github.com/alexandercerutti/hapns/blob/master/examples/Apple-Wallet-Passes/README.md Install dependencies using pnpm and run the example server. Choose either the token-based or certificate-based example. ```sh pnpm install ``` ```sh pnpm run:example:token # or pnpm run:example:certificates ``` -------------------------------- ### Start Node.js Server Source: https://github.com/alexandercerutti/hapns/blob/master/examples/LiveActivityNotification-example/README.md Execute this command in a terminal to start the Node.js server component of the example. ```sh $ pnpm run:server ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/alexandercerutti/hapns/blob/master/examples/LiveActivityNotification-example/ios-app/README.md Run this command in the `LiveActivityNotification-example` directory to install project dependencies. ```bash pnpm install ``` -------------------------------- ### Run the Node.js Server Source: https://github.com/alexandercerutti/hapns/blob/master/examples/LiveActivityBroadcastChannelNotification-example/README.md Starts the Node.js server for the Live Activity broadcast example. The server will listen on a port and provide options for managing channels and Live Activities. ```sh pnpm run:server ``` -------------------------------- ### Run Server Example with pnpm Source: https://github.com/alexandercerutti/hapns/blob/master/examples/BackgroundNotification-example/README.md Execute these commands to set up and run the server-side example. This assumes hapns is managed as a workspace dependency via pnpm. ```sh $ pnpm run:setup $ pnpm run:example ``` -------------------------------- ### Install Project Dependencies with pnpm Source: https://github.com/alexandercerutti/hapns/blob/master/specs/e2e/README.md Installs all project dependencies using the pnpm package manager. Ensure pnpm is installed globally before running. ```sh $ pnpm install ``` -------------------------------- ### Install Dependencies and Build hapns Source: https://github.com/alexandercerutti/hapns/blob/master/examples/LiveActivityNotification-example/README.md Run this command to install project dependencies and build the hapns library within the workspace. ```sh $ pnpm run:setup ``` -------------------------------- ### Run Alert Notification Example Server Source: https://github.com/alexandercerutti/hapns/blob/master/examples/AlertNotification-example/README.md Commands to set up and run the Node.JS server for the alert notification example. Assumes pnpm is used for package management within a workspace. ```sh pnpm run:setup pnpm run:example ``` -------------------------------- ### Run Printer Simulator Source: https://github.com/alexandercerutti/hapns/blob/master/examples/LiveActivityNotification-example/ios-app/README.md Start the printer simulator service from the `LiveActivityNotification-example` root directory in a separate terminal. ```bash pnpm run:printer ``` -------------------------------- ### Start Node.js 3D Printer Emulator Source: https://github.com/alexandercerutti/hapns/blob/master/examples/LiveActivityNotification-example/README.md Run this command in a separate terminal to start the 3D printer emulator. This process communicates with the server on port 3000 and listens for Live Activity updates. ```sh $ pnpm run:printer ``` -------------------------------- ### Install Dependencies and Build hapns Source: https://github.com/alexandercerutti/hapns/blob/master/examples/LiveActivityBroadcastChannelNotification-example/README.md Installs project dependencies and builds the hapns library using pnpm. This command assumes hapns is part of a workspace. ```sh pnpm run:setup ``` -------------------------------- ### Run the Node.js Server Source: https://github.com/alexandercerutti/hapns/blob/master/specs/e2e/README.md Starts the Node.js server application. This server is responsible for communication between the iOS app and the Node.js test. ```sh $ node server/server.js ``` -------------------------------- ### Send Alert Notification with Token Connector Source: https://github.com/alexandercerutti/hapns/blob/master/README.md Example of sending an alert notification to a device using token-based authentication. Ensure you have the necessary key files and identifiers configured. ```javascript import { AlertNotification } from "hapns/notifications/AlertNotification"; import { Device } from "hapns/targets/device"; import { TokenConnector } from "hapns/connectors/token"; import { send } from "hapns/send"; const TOKEN_KEY_PATH = ""; const KEY_ID = ""; const TEAM_ID = ""; const DEVICE_TOKEN = "..."; const APNS_TOPIC = ""; const USE_SANDBOX = true; const p8key = new Uint8Array(fs.readFileSync(TOKEN_KEY_PATH)); const connector = TokenConnector({ key: p8key, keyId: KEY_ID, teamIdentifier: TEAM_ID, }); const device = Device(DEVICE_TOKEN); const notification = AlertNotification(APNS_TOPIC, { payload: { alert: { title: "Hello World", body: "This is a test notification", }, sound: "default", badge: 0, }, appData: { myCustomData: "Hello World", }, priority: 10, }); const deliveryResponse = await send(connector, notification, device, { useSandbox: USE_SANDBOX }); console.log(deliveryResponse); ``` -------------------------------- ### LiveActivityNotification Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Creates a Live Activity notification. This function accepts the application bundle ID and notification data. The `NotificationData` object can include `payload` and `appData`, along with standard header parameters. The `payload` is structured by an `event` key, allowing for different parameters for 'start', 'update', or 'end' events. ```APIDOC ## LiveActivityNotification ### Description Creates a Live Activity notification. This function accepts the application bundle ID and notification data. The `NotificationData` object can include `payload` and `appData`, along with standard header parameters. The `payload` is structured by an `event` key, allowing for different parameters for 'start', 'update', or 'end' events. ### Function Signature ```ts function LiveActivityNotification(appBundleId: string, data: NotificationData): Notification; ``` ### Parameters #### `appBundleId` (string) - **Description**: Application BundleID. #### `data` (NotificationData) - **Description**: Notification data object. - **`payload`** (object) - Optional. Payload for the notification, structured by the `event` key. - **`event`** (string) - Required. Specifies the event type: `start`, `update`, or `end`. - **`[event-specific parameters]`** - Parameters relevant to the specified `event`. - **`appData`** (object) - Optional. Custom application data. ### Event Types #### `start` - Accepts parameters specific to starting a Live Activity. #### `update` - Accepts parameters specific to updating a Live Activity. #### `end` - Accepts parameters specific to ending a Live Activity. ### Notes - When using plain Javascript, parameters not belonging to the correct `event` will be ignored. ``` -------------------------------- ### Module Augmentation for Custom App Data Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Example of augmenting the NotificationCustomAppData interface for AlertNotification to include custom fields. This is a TypeScript-only feature and requires module augmentation. ```typescript declare module "hapns/notifications/AlertNotification" { export interface NotificationCustomAppData { myCustomField: number } } ``` -------------------------------- ### Create a Device Target Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Instantiate a `Device` target by providing the device token. ```typescript export function Device(deviceToken: string): NotificationTarget; ``` -------------------------------- ### Import Notification Targets Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Import the `Device` and `BroadcastChannel` classes for creating notification targets. ```typescript import { Device } from "hapns/targets/device"; import { BroadcastChannel } from "hapns/targets/broadcastchannel"; ``` -------------------------------- ### Import Token and Certificate Connectors Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Import the necessary connector classes from the HAPNS library. Ensure you choose the connector that aligns with your notification requirements. ```typescript import { TokenConnector } from "hapns/connectors/token"; import { CertificateConnector } from "hapns/connectors/certificate"; ``` -------------------------------- ### Import Broadcast Channel Creation Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Import the function to create a new broadcast channel. ```typescript import { createBroadcastChannel } from "hapns/channels/broadcast"; ``` -------------------------------- ### Initialize CertificateConnector Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Create an instance of CertificateConnector using your SSL certificate and private key. This connector is used for establishing HTTP/2 connections to APNs. ```typescript import { CertificateConnector } from "hapns/connectors/certificate"; const connector = CertificateConnector({ cert: new Uint8Array(fs.readFileSync("...")), key: new Uint8Array(fs.readFileSync("...")), passphrase: "123456", }); ``` -------------------------------- ### Initialize TokenConnector Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Instantiate the TokenConnector with your authentication details. This connector handles JWT token creation and management for APNs communication. ```javascript import { TokenConnector } from "hapns/connectors/token"; const connector = TokenConnector({ key: new Uint8Array(fs.readFileSync(TOKEN_KEY_PATH)), keyId: KEY_ID, teamIdentifier: TEAM_ID, }); ``` -------------------------------- ### Import the Send Function Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Import the `send` function to deliver notifications. ```typescript import { send } from "hapns/send"; ``` -------------------------------- ### createBroadcastChannel Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Creates a new broadcast channel. Requires a connector and settings including bundle ID, message storage policy, APNS request ID, and sandbox environment flag. ```APIDOC ## createBroadcastChannel ### Description Creates a new broadcast channel. Requires a connector and settings including bundle ID, message storage policy, APNS request ID, and sandbox environment flag. ### Signature ```ts async function createBroadcastChannel(connector: ConnectorProtocol, settings: BroadcastChannelSettings): Promise; ``` ### Parameters #### Settings Object - **bundleId** (string) - Required - Bundle ID associated with the channel - **messageStoragePolicy** (0 | 1) - Optional - How long the message should be kept by APN - **apnsRequestId** (string) - Optional - Request Id to be sent with the request - **useSandbox** (boolean) - Optional - Provide this flag to go on production or use the sandbox environment ### Returns A `BroadcastChannel` target object containing `bundleId` and `channelId`. ``` -------------------------------- ### Create a Broadcast Channel Target Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Instantiate a `BroadcastChannel` target using the channel ID and bundle ID. ```typescript function BroadcastChannel(channelId: string, bundleId: string): BroadcastChannel; ``` -------------------------------- ### Run the Node.js End-to-End Test Source: https://github.com/alexandercerutti/hapns/blob/master/specs/e2e/README.md Executes the Node.js end-to-end integration test using the built-in test runner. This command should be run in a separate terminal from the server. ```sh $ node --test integration.spec.mjs ``` -------------------------------- ### Device Target Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Creates a notification target for a specific device using its device token. ```APIDOC ## Device ### Description Represents a notification target for a specific device. ### Signature ```typescript export function Device(deviceToken: string): NotificationTarget; ``` ### Parameters - **deviceToken** (string) - The unique token of the device to which notifications will be delivered. ``` -------------------------------- ### readAllBroadcastChannels Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Retrieves all broadcast channels for a given bundle ID in a specific environment. Requires a connector and bundle ID, with optional settings for APNS request ID and sandbox environment. ```APIDOC ## readAllBroadcastChannels ### Description Retrieves all broadcast channels for a given bundle ID in a specific environment. Requires a connector and bundle ID, with optional settings for APNS request ID and sandbox environment. ### Signature ```ts async function readAllBroadcastChannels(connector: ConnectorProtocol, bundleId: string, settings?: ChannelReadSettings): Promise; ``` ### Parameters #### Settings Object (Optional) - **apnsRequestId** (string) - Optional - Provide a custom `apns-request-id` that will be returned with the response - **useSandbox** (boolean) - Optional - Provide this flag to go on production or use the sandbox environment ### Returns An array of `BroadcastChannel` objects. ``` -------------------------------- ### Create Background Notification Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Use this function to create a background notification. Payload is forbidden as only `content-available` is supported. Priority is automatically set to 5. ```javascript import { BackgroundNotification } from "hapns/notifications/BackgroundNotification"; const notification = BackgroundNotification("com.x.y.myapp", { appData: { myCustomData: 5 } }); ``` -------------------------------- ### BackgroundNotification Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Creates a background notification. It accepts an application bundle ID and notification data. For background notifications, passing a `payload` in `data` is forbidden and will be ignored. Only `appData` can be provided. The `priority` is automatically set to 5. ```APIDOC ## BackgroundNotification ### Description Creates a background notification. It accepts an application bundle ID and notification data. For background notifications, passing a `payload` in `data` is forbidden and will be ignored. Only `appData` can be provided. The `priority` is automatically set to 5. ### Function Signature ```ts function BackgroundNotification(appBundleId: string, data: NotificationData): Notification; ``` ### Parameters #### `appBundleId` (string) - **Description**: Application or Pass (Apple Wallet) BundleID. #### `data` (NotificationData) - **Description**: Notification data object. Only `appData` can be provided. - **`appData`** (object) - Required. Custom application data. ### Constraints - Passing a `payload` in `data` is forbidden and will be ignored. - `priority` is ignored, as automatically and forcefully set to 5. ### Request Example ```js import { BackgroundNotification } from "hapns/notifications/BackgroundNotification"; const notification = BackgroundNotification("com.x.y.myapp", { appData: { myCustomData: 5 } }); ``` ``` -------------------------------- ### Import VoipNotification from hapns/notifications Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Demonstrates how to import a specific notification type, VoipNotification, from the hapns/notifications namespace. This is a TypeScript-only feature. ```typescript import { VoipNotification } from "hapns/notifications/VoipNotification"; ``` -------------------------------- ### AlertNotification Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Creates an alert notification. It accepts an application bundle ID and notification data. The payload within the data object can include various fields like alert, badge, sound, etc., as defined by Apple's notification payload reference. Specific constraints apply to the 'alert' field and localization keys in TypeScript. ```APIDOC ## AlertNotification ### Description Creates an alert notification. It accepts an application bundle ID and notification data. The payload within the data object can include various fields like alert, badge, sound, etc., as defined by Apple's notification payload reference. Specific constraints apply to the 'alert' field and localization keys in TypeScript. ### Function Signature ```ts function AlertNotification(appBundleId: string, data: NotificationData): Notification; ``` ### Parameters #### `appBundleId` (string) - **Description**: Application or Pass (Apple Wallet) BundleID. #### `data` (NotificationData) - **Description**: Notification data object. - **`payload`** (object) - Optional. Payload in data for this notification, contains fields applicable to this notification type. - **`appData`** (object) - Optional. Custom application data. ### Payload Fields (within `data.payload`) - **`alert`** (object | string) - Optional. The alert content. - **`badge`** (number) - Optional. The badge count. - **`sound`** (string) - Optional. The sound to play. - **`threadId`** (string) - Optional. Thread identifier. - **`category`** (string) - Optional. Notification category. - **`mutableContent`** (number) - Optional. Mutable content for the notification. - **`targetContentId`** (string) - Optional. Target content identifier. - **`interruptionLevel`** (string) - Optional. Interruption level of the notification. - **`relevanceScore`** (number) - Optional. Relevance score for the notification. - **`filterCriteria`** (object) - Optional. Filter criteria for the notification. ### Constraints (TypeScript Only) - `alert` can be an empty object (`{}`), a string, or an object. - If `alert` is `{}`, `badge` and `sound` are not allowed, and an error will be returned. An empty object is allowed for Apple Wallet notifications. - Localization keys (`title-loc-key`, `loc-key`, `subtitle-loc-key`) are mutually exclusive with their non-localization counterparts (`title`, `body`, `subtitle`). ### Request Example ```js import { AlertNotification } from "hapns/notifications/AlertNotification"; const notification = AlertNotification("com.x.y.myapp", { priority: 10, payload: { alert: { "title-loc-key": "ALERT_TITLE", "title-loc-args": ['Hello', 'hapns'] } }, appData: { myCustomData: 5 } }); ``` ``` -------------------------------- ### CertificateConnector Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Initializes a CertificateConnector for handling certificate-based authentication with APNs. This connector attaches certificate and key information to HTTP/2 requests. ```APIDOC ## CertificateConnector ### Description Initializes a CertificateConnector for handling certificate-based authentication with APNs. This connector attaches certificate and key information to HTTP/2 requests. ### Signature ```ts function CertificateConnector(details: CertificateConnectorData): ConnectorProtocol; ``` ### Parameters #### CertificateConnectorData - **cert** (`Uint8Array`) - Mandatory - Certificate file buffer to be sent when establishing an HTTP/2 connection to APNs. For Apple Wallet notifications, this should be the certificate used to sign the pass. - **key** (`Uint8Array`) - Mandatory - The private key file buffer for the certificate. For Apple Wallet notifications, this should be the private key used to sign the pass. - **passphrase** (`string`) - Optional - The passphrase for the private key. If omitted and the key is encrypted, an error might be thrown. ### Example ```ts import { CertificateConnector } from "hapns/connectors/certificate"; const connector = CertificateConnector({ cert: new Uint8Array(fs.readFileSync("...")), key: new Uint8Array(fs.readFileSync("...")), passphrase: "123456", }); ``` ``` -------------------------------- ### Send Notification Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Sends a notification to a specified target using a connector and optional sending settings. ```APIDOC ## send() ### Description Sends a notification to a specified target. This function orchestrates the delivery of notifications by combining a connector, the notification content, and the target recipient. ### Signature ```typescript function send(connector: ConnectorProtocol, notification: Notification, target: NotificationTarget, settings?: SendingOptions): Promise; ``` ### Parameters - **connector** (ConnectorProtocol) - The protocol used for connecting to the notification service. - **notification** (Notification) - The notification payload to be sent. - **target** (NotificationTarget) - The recipient of the notification. - **settings** (SendingOptions, optional) - Optional settings for the notification delivery. - **useSandbox** (boolean, optional) - Set to true to use the sandbox environment for APNs. - **apnsId** (string, optional) - A custom APNs ID to be included in the response. ``` -------------------------------- ### Create Broadcast Channel Function Signature Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Signature for creating a broadcast channel. Requires a connector and broadcast channel settings. ```typescript async function createBroadcastChannel(connector: ConnectorProtocol, settings: BroadcastChannelSettings): Promise; ``` -------------------------------- ### Create Alert Notification Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Use this function to create an alert notification. It supports localized alert messages and custom app data. Note that certain combinations of alert fields are mutually exclusive. ```javascript import { AlertNotification } from "hapns/notifications/AlertNotification"; const notification = AlertNotification("com.x.y.myapp", { priority: 10, payload: { alert: { "title-loc-key": "ALERT_TITLE", "title-loc-args": ['Hello', 'hapns'] } }, appData: { myCustomData: 5 } }); ``` -------------------------------- ### TokenConnector Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Initializes a TokenConnector for handling JWT token-based authentication with APNs. This connector manages token creation, caching, and regeneration. ```APIDOC ## TokenConnector ### Description Initializes a TokenConnector for handling JWT token-based authentication with APNs. This connector manages token creation, caching, and regeneration. ### Signature ```ts export function TokenConnector(details: TokenConnectorData): ConnectorProtocol; ``` ### Parameters #### TokenConnectorData - **key** (`Uint8Array`) - Mandatory - PKCS 8 file content to be used as the private key. - **keyId** (`string`) - Mandatory - A 10-character string Key ID provided by Apple. - **teamIdentifier** (`string`) - Mandatory - The team ID of the Apple Developer Account. ### Example ```js import { TokenConnector } from "hapns/connectors/token"; const connector = TokenConnector({ key: new Uint8Array(fs.readFileSync(TOKEN_KEY_PATH)), keyId: KEY_ID, teamIdentifier: TEAM_ID, }); ``` ``` -------------------------------- ### Send Notification Function Signature Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference The `send` function orchestrates notification delivery with connector, notification, target, and optional settings. ```typescript function send(connector: ConnectorProtocol, notification: Notification, target: NotificationTarget, settings?: SendingOptions): Promise; ``` -------------------------------- ### Read All Broadcast Channels Function Signature Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Signature for reading all broadcast channels for a given bundle ID. Requires a connector and the bundle ID. ```typescript async function readAllBroadcastChannels(connector: ConnectorProtocol, bundleId: string, settings?: ChannelReadSettings): Promise { ``` -------------------------------- ### BroadcastChannel Target Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Creates a notification target for a broadcast channel, identified by its channel ID and bundle ID. ```APIDOC ## BroadcastChannel ### Description Represents a notification target for a broadcast channel. ### Signature ```typescript function BroadcastChannel(channelId: string, bundleId: string): BroadcastChannel; ``` ### Parameters - **channelId** (string) - The ID of the broadcast channel. - **bundleId** (string) - The bundle ID of the application associated with the channel. ``` -------------------------------- ### readBroadcastChannel Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Retrieves the settings for a specific broadcast channel. Requires a connector and the broadcast channel object, with optional settings for APNS request ID and sandbox environment. ```APIDOC ## readBroadcastChannel ### Description Retrieves the settings for a specific broadcast channel. Requires a connector and the broadcast channel object, with optional settings for APNS request ID and sandbox environment. ### Signature ```ts async function readBroadcastChannel(connector: ConnectorProtocol, bChannel: BroadcastChannel, settings?: ChannelReadSettings): Promise; ``` ### Parameters #### Settings Object (Optional) - **apnsRequestId** (string) - Optional - Provide a custom `apns-request-id` that will be returned with the response - **useSandbox** (boolean) - Optional - Provide this flag to go on production or use the sandbox environment ### Returns A `ChannelReadResponseBody` object containing `messageStoragePolicy` (number) and `pushType` (string). ``` -------------------------------- ### NotificationData Interface Structure Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Defines the generic interface for notification data, including optional fields like expiration, collapseID, priority, payload, and appData. The structure of payload and appData depends on the specific notification type. ```typescript interface NotificationData { expiration?: number; collapseID?: string; priority?: Priority; payload?: NotificationPayload; appData?: AppPayload; } ``` -------------------------------- ### Complication Notification Placeholder Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Placeholder for Complication Notification function. ```javascript /** * @TODO */ ``` -------------------------------- ### Read Broadcast Channel Function Signature Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Signature for reading a broadcast channel. Requires a connector and a BroadcastChannel object. ```typescript async function readBroadcastChannel(connector: ConnectorProtocol, bChannel: BroadcastChannel, settings?: ChannelReadSettings): Promise ``` -------------------------------- ### Delete Broadcast Channel Function Signature Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Signature for deleting a broadcast channel. Requires a connector and a BroadcastChannel object. ```typescript async function deleteBroadcastChannel(connector: ConnectorProtocol, bChannel: BroadcastChannel, settings?: ChannelDeleteSettings): Promise<{ success: true; apnsRequestId: string }> { ``` -------------------------------- ### deleteBroadcastChannel Source: https://github.com/alexandercerutti/hapns/wiki/API-Documentation-Reference Deletes a broadcast channel. Requires a connector and the broadcast channel object, with optional settings for APNS request ID and sandbox environment. ```APIDOC ## deleteBroadcastChannel ### Description Deletes a broadcast channel. Requires a connector and the broadcast channel object, with optional settings for APNS request ID and sandbox environment. ### Signature ```ts async function deleteBroadcastChannel(connector: ConnectorProtocol, bChannel: BroadcastChannel, settings?: ChannelDeleteSettings): Promise<{ success: true; apnsRequestId: string }>; ``` ### Parameters #### Settings Object (Optional) - **apnsRequestId** (string) - Optional - Provide a custom `apns-request-id` that will be returned with the response - **useSandbox** (boolean) - Optional - Provide this flag to go on production or use the sandbox environment ### Returns An object with `success` (always `true`) and the `apnsRequestId`. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.