Push
Test mode
Test keys send nothing to Apple or Google and charge nothing. Magic tokens simulate each outcome.
Test mode
A test key (mk_test_) registers test devices and sends through a stub: nothing goes to Apple or Google, nothing is charged, and test pushes do not use your free allotment. Register a device with one of these tokens to simulate an outcome.
| Device token | Outcome |
|---|---|
| test_accept | Accepted. Any other token is accepted too. |
| test_unregistered | Rejected as unregistered: the device is deactivated and push_device.deactivated fires. |
| test_bad_credentials | The credential is rejected: push_app.credentials_invalid fires, with no change to your real credential. |
| test_retry_then_accept | The first attempt fails with a retryable error and the second is accepted. |
cURL
curl -X PUT https://api.honkio.ca/v1/push/devices \
-H "Authorization: Bearer mk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"app_id": "APP_ID",
"token": "test_accept",
"platform": "ios",
"user_id": "user_1042",
"apns_environment": "sandbox",
"encryption_public_key": "DEVICE_PUBLIC_KEY"
}'
# Response: { "id": "pdev_...", "active": true, "encryption_key_id": "cHRL-UfvREIeEx3Q", ... }Webhooks fire with livemode false. A fallback text in test mode goes through SMS test mode. Devices and sends are separate per mode, while apps and their credentials are shared: only a live key creates or changes them, and they are verified for real on upload. Test mode allows 1,000 pushes a day and 1,000 active devices per app, and the stub answers at once, simulated retries included.
HonkIO