Bulk Sending

jxpush includes a high-performance bulk sending mechanism. It automatically handles batching (splitting large lists into chunks) and concurrency limits.

sendMulticast

Use the sendMulticast method to send messages to thousands of devices efficiently.

typescript
const messages = [
    { token: 'token-1', notification: { title: 'Update' } },
    { token: 'token-2', notification: { title: 'Update' } },
    // ... up to thousands
];

const result = await client.sendMulticast(messages);

console.log(`Sent: ${result.successCount}, Failed: ${result.failureCount}`);

Features

  • Automatic Batching: Messages are processed in chunks (default: 500) to respect provider limits (e.g., FCM's 500 limit).
  • Rate Limiting: If configured, the client respects rate limits during bulk sends.
  • Detailed Reporting: Returns a summary object with total counts and individual results for debugging.