sendvia sends push notifications straight to Apple, Google and the browser push services, signed with keys you upload once. The API key that sends your email also registers devices and sends to them. Push is a paid add-on to Premium, with 100,000 deliveries a month.
Yes, to iPhone and iPad apps, Android apps and websites, from the same API key that sends your email. Push is a paid add-on to the Premium plan.
| Platform | You upload | The token is | Notes |
|---|---|---|---|
| iPhone and iPad apps | A .p8 key, Key ID, Team ID and bundle ID | The device token from Apple, as hex | Register with "environment": "sandbox" for builds run from Xcode, production for everything else |
| Android apps | The Firebase service account JSON file | The registration token from Firebase Cloud Messaging | Needs the Firebase Cloud Messaging API turned on in the project |
| Websites | Nothing; sendvia generates the keys | The browser's push subscription object | Chrome, Edge, Firefox and Safari. On iPhone and iPad, only for a site added to the home screen, on iOS 16.4 or later |
No. sendvia talks to Apple's push service directly with the .p8 key from your Apple developer account, so an iPhone app needs no Firebase code. Firebase is only needed for Android apps. If your iPhone app already gets its push tokens from Firebase, register those as "provider": "google" instead, and Firebase hands them on to Apple with the Apple key you gave Firebase.
Yes. Visitors who allow notifications in Chrome, Edge, Firefox or Safari get them while their browser is running, even with your site closed. On iPhone and iPad, Apple only allows it for a site added to the home screen, on iOS 16.4 or later.
The website needs one file on its own domain, sendvia-push-sw.js, the small service worker that shows each notification and opens its link when clicked. It has no fetch handler, so it never touches how your pages load. sendvia generates the signing keys the browsers check, or you import a pair you already use, and the dashboard gives you the few lines of script that ask the visitor for permission.
There are three parts, and only the last two are code.
POST /v1/push/devices with your user ID for that person. The API key stays on your server; an app should never carry it.POST /v1/push/send with that same user ID reaches every active device they have registered, iPhone, Android and browser alike, in one request.sendvia calls Apple, Google and the browser push services itself, so there is no third party in between holding a copy of your device list.
Pass the token with "provider": "apple" or "google", or the whole subscription with "provider": "web". user_id is your own identifier for the person, up to 255 characters; sendvia never interprets it.
curl -X POST https://api.sendvia.io/v1/push/devices \
-H "Authorization: Bearer sv_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"provider": "apple",
"token": "a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90",
"user_id": "42"
}'
A website sends what the browser's pushManager.subscribe() returned, as is:
{
"provider": "web",
"user_id": "42",
"subscription": {
"endpoint": "https://fcm.googleapis.com/fcm/send/dX8aBcDeFgH...",
"keys": { "p256dh": "BNcRdreALRFX...", "auth": "tBHItJI5svbpez7KI4CCXg" }
}
}
Registering the same token again is safe, and is how you should handle an app launch: it refreshes the device and brings it back to active if it had been marked dead. To forget a device at logout, DELETE /v1/push/devices with {"token": "..."}.
curl -X POST https://api.sendvia.io/v1/push/send \
-H "Authorization: Bearer sv_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"user_id": "42",
"title": "Your order has shipped",
"body": "It should arrive on Thursday. Tap to track it.",
"url": "/orders/1234",
"data": { "order_id": "1234" },
"tag": "shipping"
}'
Target either user_id (one, or a list of up to 100) or device_id (one, or a list of up to 500), never both. The response has one entry per device:
{
"success": true,
"total": 2, "sent": 2, "failed": 0, "invalid": 0,
"results": [
{"device_id": 17, "provider": "apple", "user_id": "42", "status": "sent", "log_id": 9001},
{"device_id": 52, "provider": "web", "user_id": "42", "status": "sent", "log_id": 9002}
]
}
The HTTP status follows the same rule as a multi-recipient email send: 200 when every device was reached, 207 when some were and some were not, 502 when none were. Send an Idempotency-Key header and a retry within 24 hours returns the original response instead of a second notification. Leave out title and body and send data on its own for a silent push that wakes an app without showing anything; websites cannot receive those, because browsers require every push to show a notification.
Every option goes in the same send request, and each platform ignores what is not for it, so one request can carry the lot. These drawings are approximate; each operating system draws its own.
| Option | Field | Websites | iPhone | Android app |
|---|---|---|---|---|
| Title and text | title, body | Yes | Yes | Yes |
| Subtitle | subtitle | No | Yes | No |
| Icon | icon, android_icon | Yes | Always the app icon | Small icon from the app |
| Accent colour | color | No | No | Yes |
| Small badge icon | badge_icon | Android browsers only | No | No |
| Large image | image | Chrome and Edge | Needs an app extension | Yes |
| Buttons | actions, category | Up to 2, Chrome and Edge | Defined in the app | Defined in the app |
| Link opened on click | url | Yes | Send it in data | Send it in data |
| Number on the app icon | badge | Home screen apps | Yes | Launcher dependent |
| Group or replace | group, collapse_key | Replace only | Yes | Replace only |
| Interruption level | interruption_level | No | Yes | No |
| Stay on screen | require_interaction, sticky | Chrome and Edge | No | Yes |
| Sound and vibration | sound, vibrate | Silent or vibrate | Yes | Yes |
| Channel and lock screen | channel_id, visibility | No | No | Yes |
A website can also set a default icon, badge icon and click-through link once in the dashboard, so a send only names them when it wants something different. Critical alerts on iPhone, the ones that sound through silent mode, need an entitlement Apple only grants to apps such as health, safety and security ones; without it the notification plays as an ordinary one.
Apple, Google and the browsers say so the next time you send to that device. sendvia marks the device invalid with the reason, stops sending to it, and deletes it 30 days later, the same way a hard bounce lands on the email blocklist. If the person reinstalls, your server registers the new token and it starts receiving again. The dashboard shows every device, its status and the last push it was sent, and a test button that sends one to it.
The add-on includes 100,000 deliveries a month, and one delivery is one device a notification is handed to. Sending to someone with a phone and a laptop uses two. The count resets on the 1st, and it is checked before anything goes out: a send that would cross the allowance is refused whole with a 429 rather than reaching some devices and not others. Apple, Google and the browsers do not charge per notification, so there is no second bill the way Amazon bills for email.
They are encrypted with AES-256-GCM before they are stored, and only decrypted to sign requests to Apple and Google. The private key is never shown again after upload, and removing it in the dashboard deletes it. A website's private signing key is stored the same way.
title up to 255 characters and body up to 1,000. Everything in one notification together has to fit in about 4 KB, which is the limit Apple, Google and the browsers set.The full request and response reference for all six push endpoints is in the API reference.