ابرووا
شروع رایگان
☰ فهرست مستندات · زمان‌بندی
به‌زودی. Abrova Push به‌زودی فعال می‌شود. این صفحه توضیح می‌دهد چطور کار خواهد کرد؛ هنوز قابل استفاده نیست.
این صفحه هنوز ترجمه نشده — نسخه‌ی انگلیسی نمایش داده می‌شود. English

Scheduled Messages

Schedule push notifications for delivery at a specific future time — marketing campaigns, event reminders, time-sensitive content, global audiences.

به‌روزرسانی: ۵ آبان ۱۴۰۵

Schedule push notifications for delivery at a specific future time.

Use Cases#

  • Marketing campaigns — send at optimal engagement times
  • Event reminders — notify before appointments
  • Time-sensitive content — flash sales, limited offers
  • Global audiences — schedule separate messages for each region's local time

Schedule a Message#

scheduledAt is an ISO 8601 timestamp and must be in the future; it is the exact instant the message is sent. timezone is optional (defaults to UTC) and is stored with the message for display only — it does not shift scheduledAt, so include the offset (or use Z) in scheduledAt itself. Due messages are picked up once a minute. Only title, body and data are delivered with a scheduled message.

Node.js SDK

typescript
import { AbrovaPush } from '@abrova/push-node';

const abrovaPush = new AbrovaPush({
  apiKey: 'ab_live_your_api_key',
  serverSecret: 'ab_srv_your_server_secret',
});

const scheduled = await abrovaPush.scheduled.create({
  title: 'Flash Sale!',
  body: '50% off for the next 2 hours',
  targetType: 'broadcast',
  scheduledAt: '2024-01-20T10:00:00Z',
  timezone: 'Asia/Tehran',
});

REST API

bash
curl -X POST "https://push-api.abrova.ir/scheduled" \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Flash Sale!",
    "body": "50% off for the next 2 hours",
    "targetType": "broadcast",
    "scheduledAt": "2024-01-20T10:00:00Z",
    "timezone": "Asia/Tehran"
  }'

Target Types#

OptionTypeRequiredDescription
broadcast--Send to all devices (no targetValue required)
device--Send to specific device (targetValue = device ID)
user--Send to user's devices (targetValue = user ID)
topic--Send to topic subscribers (targetValue = topic name)
segment--Scheduled messages can't target segments; send to a segment immediately.

Target Specific Devices/Users#

Node.js SDK

typescript
await abrovaPush.scheduled.create({
  title: 'Your appointment reminder',
  body: "Don't forget your meeting in 1 hour",
  targetType: 'user',
  targetValue: 'user_123',
  scheduledAt: '2024-01-20T09:00:00Z',
  timezone: 'Asia/Tehran',
});

REST API

bash
curl -X POST "https://push-api.abrova.ir/scheduled" \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Your appointment reminder",
    "body": "Dont forget your meeting in 1 hour",
    "targetType": "user",
    "targetValue": "user_123",
    "scheduledAt": "2024-01-20T09:00:00Z",
    "timezone": "Asia/Tehran"
  }'

List Scheduled Messages#

Node.js SDK

typescript
const messages = await abrovaPush.scheduled.list();

// Or only pending
const pending = await abrovaPush.scheduled.listPending();

REST API

bash
curl -X GET "https://push-api.abrova.ir/scheduled" \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret"

Response

json
[
  {
    "id": "sch_abc123",
    "title": "Flash Sale!",
    "body": "50% off for 2 hours",
    "targetType": "broadcast",
    "scheduledAt": "2024-01-20T10:00:00Z",
    "timezone": "Asia/Tehran",
    "status": "pending",
    "createdAt": "2024-01-15T12:00:00Z"
  }
]

Message Status#

OptionTypeRequiredDescription
pending--Waiting for scheduled time
processing--Currently being sent
sent--Successfully sent
failed--Failed to send
cancelled--Cancelled before sending

Cancel a Scheduled Message#

Cancel a pending message before it's sent. Only messages with status pending can be cancelled (or updated with PUT /scheduled/:id / abrovaPush.scheduled.update(id, {...})).

Node.js SDK

typescript
await abrovaPush.scheduled.cancel('sch_abc123');

REST API

bash
curl -X POST "https://push-api.abrova.ir/scheduled/sch_abc123/cancel" \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret"

Delete a Scheduled Message#

Node.js SDK

typescript
await abrovaPush.scheduled.delete('sch_abc123');

REST API

bash
curl -X DELETE "https://push-api.abrova.ir/scheduled/sch_abc123" \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret"
این صفحه مفید بود؟
گزارش مشکل