Push Notifications
Push needs credentials for each platform you send to. Set up each platform you ship on in the Arsel Dashboard under Push > Setup.
| Platform | What you supply | Where it comes from |
|---|---|---|
| Android | A Firebase service-account JSON | Your own Firebase project |
| iOS | An APNs auth key (.p8) plus its Key ID, your Team ID and your bundle ID | Apple Developer |
| Web | The origins allowed to register devices | Nothing external — Arsel generates the keys |
- Set up the platforms you ship on, using the sections below.
- Copy your client key (
pub_…) and give it to whoever integrates the SDK.
Credentials
Arsel sends with the credentials you upload, so device tokens you already hold keep working after you migrate. Revoking the service account key or the APNs key stops Arsel sending immediately, without involving support. FCM quota is your project's.
iOS and Firebase
Arsel sends to Apple directly. There is no Firebase project in the iOS path: you upload one .p8 key. If your app runs Firebase Messaging for other reasons, it does not conflict; Arsel ignores its token.
Before You Start
You need, for each platform you send to:
- Android — a Firebase project with your app registered, and Owner or Editor access to the underlying Google Cloud project, enough to create a service account.
- iOS — an Apple Developer account, and the ability to create a key under Certificates, Identifiers & Profiles.
- Web — nothing external; see Web Push below.
Android
Step 1 — Enable the Firebase Cloud Messaging API
A new Firebase project does not always have the v1 messaging API switched on.
- Open the Google Cloud console and select your Firebase project from the project dropdown.
- Go to APIs & Services > Library.
- Search for Firebase Cloud Messaging API and click Enable.
If it already reads "Manage" rather than "Enable", it is on.
Step 2 — Create a service account key
- In the Google Cloud console, go to IAM & Admin > Service Accounts.
- Either use the existing
firebase-adminsdk-…account Firebase created, or click Create Service Account and give it a descriptive name such asarsel-push-sender. - Grant it a role that includes the
cloudmessaging.messages.createpermission. The predefined Firebase Cloud Messaging API Admin role covers it, or use a custom role with only that permission. - Open the account, go to Keys > Add Key > Create new key, choose JSON, and download the file.
Anyone holding it can send push notifications through your Firebase project. Do not commit it to source control or email it around. Upload it to Arsel and then delete your local copy.
The file must contain project_id, client_email, and private_key. Arsel rejects the upload if any are missing.
Step 3 — Upload it to Arsel
- In the Arsel Dashboard, go to Push > Setup.
- Under Android, upload the JSON file.
Arsel validates the credential against FCM immediately. The first validated credential switches Android on.
If validation fails, the usual causes are:
| Symptom | Cause |
|---|---|
| Authentication rejected | The Firebase Cloud Messaging API is not enabled (Step 1) |
| Permission denied | The service account lacks cloudmessaging.messages.create |
| File rejected on upload | The JSON is missing project_id, client_email, or private_key |
Rotating the key
Upload a replacement from the same screen. The previous credential keeps serving in-flight sends until the new one validates, so rotation has no downtime. Revoke the old key in Google Cloud once the new one is active.
iOS
The APNs auth key is a single .p8 file. It does not expire, and one key serves every app in your developer team.
Step 1 — Create the key
- In the Apple Developer portal, go to Certificates, Identifiers & Profiles > Keys.
- Click +, name the key (e.g.
Arsel Push), and tick Apple Push Notifications service (APNs). - Register it and download the
.p8.
.p8 exactly onceSave it somewhere durable before you leave the page. If you lose it, revoke the key and create a new one.
The key is team-wide: it can send to every app in your developer account. Do not commit it to source control or email it around.
Step 2 — Collect the three identifiers
| Value | Where to find it |
|---|---|
| Key ID | Shown next to the key in the Keys list — 10 characters |
| Team ID | Top-right of the Apple Developer portal, or your membership page — 10 characters |
| Bundle ID | Your app's bundle identifier, e.g. com.example.app |
Step 3 — Upload it to Arsel
In Push > Setup, under iOS, upload the .p8 and fill in the three identifiers.
Arsel validates the key, the team and the bundle ID against Apple immediately.
| Symptom | Cause |
|---|---|
Bundle ID rejected (TopicDisallowed) | The bundle ID does not match an app in this team, or the key belongs to a different team |
Key rejected (InvalidProviderToken) | The Key ID or Team ID does not match the uploaded .p8, or the key lacks the APNs capability |
Debug builds vs the App Store
Apple runs two hosts: sandbox for development builds, and production for TestFlight and the App Store. A token minted for one is rejected by the other. There is nothing to configure: the same .p8 authenticates against both, and the Arsel SDK reports at registration which host its build was signed for.
Rotating the key
Upload a replacement from the same screen. The outgoing key keeps serving in-flight sends until the new one validates, so rotation has no downtime. Revoke the old key in the Apple Developer portal once the new one is active.
Web Push
Web Push uses the browser's Web Push standard with VAPID keys, which Arsel generates. It does not use Firebase, and the private key never leaves the server.
- In Push > Setup, enable Web Push.
- Add your allowed origins — every domain that may register devices, e.g.
https://shop.example.com. - Choose your signing keys: let Arsel generate a keypair (the default), or import an existing one if you are migrating (see below).
Arsel signs each push with its own VAPID contact, so you don't supply a contact address.
A client key from an origin that is not on the list is rejected. An empty allowlist denies everything.
Include every origin you serve from. Apex and www are different origins, and so are staging domains and http://localhost:4200 during development.
Your page must be served over HTTPS. http://localhost is the browser's one exemption, for local development.
Migrating an existing web audience
If you already send web push through another provider, import your existing VAPID keypair instead of letting Arsel generate one. Choose Import my existing keypair when you provision Web Push, and paste both halves.
A browser binds each subscription to the applicationServerKey it was created with, and the push service checks every send against that key. If you provision a different key, every existing subscription stops receiving pushes, with no error at setup. Browsers won't prompt those users again, so they stay unreachable until they return to your site and re-subscribe.
Arsel verifies the two halves are a matching pair before storing them.
Importing is only available the first time you provision Web Push, because overwriting a live key would strand the subscriptions bound to it. If a key has to change later, use Rotate VAPID keypair, which keeps the outgoing key serving existing subscribers during a grace period.
Handing off to your developers
Once push is configured, your integration team needs:
| What | Where to find it |
|---|---|
Client key (pub_…) | Push > Setup. Publishable — safe to ship in app code. |
API key (be_…) | Integrations > API keys. Secret — server-side only. |
| SDK installation guides | The Client SDKs overview |
| Server-side endpoints | The Push API reference |
Sending
Push targets a contact: a send reaches every active device registered to that contact. A device must be bound to a contact (by the SDK's identify() call or by Register Device) before it can be targeted.
Transactional — POST /push/send sends one notification to one contact:
curl -X POST "https://api.arsel.sa/v1/push/send" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: shipment-7731-out-for-delivery" \
-d '{
"external_id": "user_8821",
"title": "Your order shipped",
"body": "Order A-1023 is on its way — arriving Thursday.",
"deep_link": "myapp://orders/A-1023"
}'
202 means queued. GET /push/:id reports how many of the contact's devices the push provider accepted it for.
Campaigns: create a draft, target it with list_ids, tag_ids or segment_ids (optionally narrowed with target_platforms), then send or schedule.
Two things to know:
- There is no transactional exemption. A contact who opted out of push, or whose devices are no longer deliverable, cannot be reached by either path;
POST /push/sendreturns403. Use email or SMS for essential service messages. - Delivered, opened and clicked are reported by the SDK on the device. Devices registered server-side without an embedded SDK receive notifications but report nothing back. See Client SDKs.
Migrating from another push provider
Mobile
Because the Firebase sender and the Apple key stay yours, your existing device tokens remain valid:
- Export your current tokens, each with the contact identifier it belongs to.
- Import them 1,000 at a time with Bulk Register Devices, omitting
sdk_version. The import runs in the background; poll each job for its status and per-row errors to reconcile against your export. - Those devices are immediately sendable and render notifications natively.
- When you later ship a build embedding the Arsel SDK, it adopts the imported device rather than creating a duplicate.
Imported devices receive notifications but report no delivery or engagement data until the SDK is embedded. See the warning in Client SDKs.
Arsel sends to iOS through Apple directly, so an imported ios device must carry an APNs device token. If your previous provider relayed iOS through Firebase, your export holds FCM registration tokens, which Apple can't use and which can't be imported as iOS devices. Those users re-register on their own once they open a build carrying the Arsel SDK.
Exports from providers that take your APNs key or certificate directly (CleverTap among them) hold real APNs tokens and import cleanly.
If any exported tokens came from development builds, send apns_environment: the default is production, and Apple's production host rejects sandbox tokens.
Web
Web subscriptions are bound to their signing key, so you carry over the key rather than tokens. Import your existing VAPID keypair when you provision Web Push; see Migrating an existing web audience.